(reg_sign_bit_copies): New variable.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Aug 1992 01:35:35 +0000 (01:35 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Aug 1992 01:35:35 +0000 (01:35 +0000)
commitec90760f531cb597acf84721484b6474067db720
tree23395680e7907a8f2888dc377cdea6caeb1c6006
parent7a5049826798da7d94e736a2aceb7b1d3f48a855
(reg_sign_bit_copies): New variable.
(combine_instructions): Initialize it.
(set_significant): Set it.
(try_combine): Set subst_low_cuid immediately before calling `subst' to
the INSN_CUID of the lowest insn involved in the call.   Change XOR with
out-of-range constant to (not (xor ...)).
Call both split_insns and find_split_point; pass extra parm to
find_split_point.
Record I2DEST's value if I2 now sets it; similarly for I1DEST.
(find_split_point): Add new arg INSN.
If AND'ing with a large single-bit constant and we only care about
equality with zero, replace with bit extraction.
Make two shifts for ZERO_EXTRACTs unless very narrow.
(subst): Move RESTART label earlier.
If we have a simple operation applied to IF_THEN_ELSE, move the operation
inside the two arms.
(subst, case SUBREG): Use force_to_mode.
(subst, case NOT): Change (not (xor X C)) to (xor X ~C).
(subst, case NEG): Remove (neg (abs X)); redundant.
Convert (neg (xor A 1)) to (plus A -1) if A is known to be 0 or 1.
(subst, case IF_THEN_ELSE): Simplify if an arm contains a register being
tested by substiting the known value.
Put constant integer in last arm if can reverse comparison.
(subst, case SET): Use gen_lowpart_for_combine.
(subst, case AND): Make IF_THEN_ELSE when appropriate.
(subst, case IOR): (ior A C) can sometimes be just C.
(subst, case XOR): Go back and restart when canonicalizing.
(subst, case ABS): Use num_sign_bit_copies.
(make_extraction): Call force_to_mode.
(make_compound_operation): Look at optabs rather that explicitly checking
for operations and assuming we have SImode.
Handle (ashiftrt (OP (ashift foo C1) C3) C2).
(force_to_mode): Only change mode of arithmetic if optab says we have
operation in that mode.
Remove unneeded ASHIFTRT; add handling for IF_THEN_ELSE.
(significant_bits, case NEG): Call num_sign_bit_copies.
(significant_bits, case ABS, case [US]{MIN,MAX}, IF_THEN_ELSE): New.
(num_sign_bit_copies): New function.
(simplify_shift_const): Remove ASHIFTRT if value is known -1 or 0.
Use num_sign_bit_copies to simplify (ashiftrt (ashift ...) ...)
and (ashiftrt (neg ...) ...).
Remove now redundant case when VAROP is a PLUS.
(simplify_comparison): If A is known to be -1 or 0, A != -1 is A == 0.
Simplify unsigned tests that really check the sign bit.
(simplify_comparison, case ASHIFTRT): Convert to LSHIFTRT if equality
comparison with zero.
(get_last_value): Check if the desired register is set in the
insn before the one whose INSN_CUID is subst_low_cuid.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1746 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/combine.c