Commit Graph

151 Commits

Author SHA1 Message Date
Richard Kenner
b65c1b5b01 (subst, case SUBREG): Handle paradoxical SUBREG of constant.
(IF_THEN_ELSE): Add missing "else" and check for comparison before
calling reversible_comparison_p.

From-SVN: r6419
1994-01-23 19:40:58 -05:00
Richard Kenner
ad25ba1779 (simplify_comparison): Can remove NOT on both operands if we swap
comparison code.

From-SVN: r6410
1994-01-23 07:00:29 -05:00
Richard Kenner
67232b230e (simplify_comparison): Fix typo in last change.
From-SVN: r6407
1994-01-23 06:18:50 -05:00
Richard Kenner
3a19aabc45 (if_then_else_cond): Don't do anything with COMPARE.
(simplify_comparison): Strip SIGN_EXTEND, NOT, or NEG when both operands
have it.

From-SVN: r6404
1994-01-22 16:50:41 -05:00
Richard Kenner
0c314d1ab0 (num_sign_bit_copies): Ifndef WORD_REGISTER_OPERATIONS, ensure we
don't do the wrong thing if X is narrower than MODE.

From-SVN: r6403
1994-01-22 15:50:06 -05:00
Richard Kenner
abe6e52f23 (added_links_insn): New variable.
(distribute_links): Set it.
(if_then_else_cond): New function.
(try_combine): Return added_links_insn if it is earlier than what we would
otherwise return.
(subst): Generalize (OP X Y) to call if_then_else_cond instead of only
checking for an explicit IF_THEN_ELSE.
(subst, case IF_THEN_ELSE): When converting to a MULT, simplify the MULT
before putting it into OP.
(subst, case AND): Don't make IF_THEN_ELSE here; now made in generic case
earlier.

From-SVN: r6343
1993-12-31 06:44:59 -05:00
Richard Kenner
e3d616e3da (force_to_mode): Add new parm JUST_SELECT; all callers changed.
From-SVN: r6342
1993-12-31 06:27:31 -05:00
Richard Kenner
7e2a0d8ef4 (subst, case MINUS): Allow some FP simplifications if -ffast-math.
(reversible_comparison_p): FP comparisons reversible with -ffast-math.

From-SVN: r6333
1993-12-27 08:47:14 -05:00
Richard Kenner
9e69be8c65 (set_nonzero_bits_and_sign_copies, nonzero_bits): Fix errors in
SHORT_IMMEDIATES_SIGN_EXTEND code.

From-SVN: r6315
1993-12-25 09:28:45 -05:00
Richard Kenner
7bef86801b (subst, case MINUS): Canonicalize (minus A (plus A B)).
From-SVN: r6226
1993-12-13 20:58:37 -05:00
Richard Kenner
c4e861e80b (try_combine, simplify_shift_const): Add initializations for some
uninitialized variables.

From-SVN: r6148
1993-11-23 17:43:26 -05:00
Richard Kenner
2dd484ed8e (force_to_mode): Don't allow sign-extension of constants when we are
narrowing things in an IOR or XOR.

From-SVN: r6117
1993-11-19 18:24:20 -05:00
Richard Stallman
aa988991ba (force_to_mode): Don't do right-shift in a narrower mode.
From-SVN: r6105
1993-11-16 07:20:33 +00:00
Richard Kenner
137e889e24 (subst_prev_insn): New variable.
(try_combine): Set it.
(get_last_value): Use subst_prev_insn if set instead of looking for the first
insn before SUBST_LOW_CUID.

From-SVN: r6063
1993-11-10 21:34:55 -05:00
Richard Stallman
4b2cb4a295 (can_combine_p): Don't combine instructions across a volatile insn.
From-SVN: r5802
1993-10-19 04:42:27 +00:00
Richard Stallman
dfa3449bd4 Include stdio.h after gvarargs.h.
From-SVN: r5767
1993-10-13 00:20:47 +00:00
Richard Kenner
5541136b1b (subst, shift and rotate cases): Test value of SHIFT_COUNT_TRUNCATED
if it is defined.

From-SVN: r5730
1993-10-11 07:38:22 -04:00
Richard Kenner
4c002f291a (force_to_mode, case ASHIFTRT): Verify that result of making a
LSHIFTRT remains a shift.

From-SVN: r5715
1993-10-10 19:18:18 -04:00
Richard Kenner
ff12fdac9b (subst, case SUREG):Only call force_to_mode if both inner and output
modes are MODE_INT.

From-SVN: r5709
1993-10-10 10:57:01 -04:00
Richard Kenner
ceb7983c7c (force_to_mode): Sign-extend constant being truncated.
From-SVN: r5654
1993-10-07 08:14:16 -04:00
Jim Wilson
176c9e6beb (try_combine): New variable i3_subst_into_i2.
Set it for special case of substituting i3 into i2.  Use it near
end to detect when special case succeeded.  Move i2notes to
i3notes for this special case.
(distribute_notes, REG_UNUSED case): Ignore all REG_UNUSED notes
except those from I3.

From-SVN: r5639
1993-10-06 10:46:02 -07:00
Richard Kenner
d81481d3d9 (can_combine_p): Allow an insn with a REG_EQUIV note that reads memory
to be moved past an insn that writes memory.

From-SVN: r5562
1993-10-02 14:10:47 -04:00
Jim Wilson
1347292b88 (force_to_mode, LSHIFTRT case): Avoid shifts larger
than HOST_BITS_PER_WIDE_INT.

From-SVN: r5516
1993-09-28 16:00:13 -07:00
Richard Kenner
8baf60bbb8 (BYTE_LOADS_EXTEND, LOAD_EXTEND): Deleted.
(subst, force_to_mode, nonzero_bits, num_sign_bit_copies): Use new
macros LOAD_EXTEND_OP and WORD_REGISTER_OPERATION instead of
BYTE_LOADS_*_EXTEND and LOAD_EXTEND.

From-SVN: r5473
1993-09-25 08:20:33 -04:00
Doug Evans
6d7096b078 combine.c: (combinable_i3_pat): Don't add REG_DEAD notes for HARD_FRAME_POINTER_REGNUM.
* combine.c: (combinable_i3_pat): Don't add REG_DEAD notes for
HARD_FRAME_POINTER_REGNUM.
(subst, case SUBREG): Don't change register number or mode if it
is HARD_FRAME_POINTER_REGNUM.

From-SVN: r5450
1993-09-24 19:37:25 +00:00
Richard Stallman
ef026f9101 (init_reg_last_arrays): New function.
(combine_instructions): Use it.
(force_to_mode): Narrow mask to fit mode (except VOIDmode).
(record_value_for_reg): When zeroing reg_last_set_value, also
zero reg_last_set_{mode,nonzero_bits,sign_bit_copies}.
(record_dead_and_set_regs): Likewise.

From-SVN: r5430
1993-09-23 06:11:30 +00:00
Richard Kenner
d96023cfa7 (recog_for_combine): Fix typos in previous change.
From-SVN: r5354
1993-09-18 16:52:40 -04:00
Richard Kenner
974f41466f (recog_for_combine): Always reject a PARALLEL containing our special
CLOBBER.

From-SVN: r5348
1993-09-17 18:19:59 -04:00
Jim Wilson
c2f9f64eb2 (make_compound_operation): Handle the case (and (xor/ior (lshift...) (lshift...)) ...).
(make_compound_operation): Handle the case
(and (xor/ior (lshift...) (lshift...)) ...).
(make_field_assignment): In get_pos_from_mask call, only invert
bits in mode mask.

From-SVN: r5237
1993-08-31 15:08:25 -07:00
Richard Kenner
c6965c0fa2 (nonzero_bits): Fix reversed test for when we need to insert extra bits when sizes differ.
(nonzero_bits): Fix reversed test for when we need to insert extra bits when
sizes differ.
(nonzero_bits, case EQ): Always return STORE_FLAG_VALUE when returning integer
mode; remove now-redundant test.

From-SVN: r5221
1993-08-27 18:47:38 -04:00
Jim Wilson
00d4ca1c64 (simplify_shift_const...
(simplify_shift_const, XOR case): When applying
distributive law, use shift_mode and GET_MODE (varop) instead of
result_mode.

From-SVN: r5189
1993-08-19 16:17:58 -07:00
Richard Kenner
423012407e (can_combine_p): Don't reject SUBREG assignments here.
(subst): Instead, do it here, but also allow it in as a nested SUBREG since
the inner one will be eliminated.
(simplify_and_const_int): Convert (and (neg X) (const_int 1)) to a shift
when X is known to be either 0 or 1.

From-SVN: r5187
1993-08-19 16:20:37 -04:00
Richard Kenner
f0343c7490 (try_combine): Don't split a PARALLEL of a SIGN_EXTEND and the object being...
(try_combine): Don't split a PARALLEL of a SIGN_EXTEND and the object
being sign extended if we have made assumptions about the form the
I2DEST.

From-SVN: r5184
1993-08-18 19:30:08 -04:00
Richard Kenner
0840fd91a3 (nonzero_bits): Handle case when BYTE_LOADS_EXTEND is not on and we
are asked for something in a mode wider than it.

From-SVN: r5183
1993-08-18 17:48:33 -04:00
Richard Kenner
e28f57321d (use_crosses_set_p): Check for partially overlapping hard regs.
From-SVN: r5163
1993-08-16 11:16:14 -04:00
Richard Kenner
f085c9cdc4 (combine_instructions): Fix typo on test of basic block number.
From-SVN: r5134
1993-08-11 17:58:31 -04:00
Richard Kenner
312def2eda (num_sign_bit_copies): Properly handle case when MODE is narrower than that of X.
(num_sign_bit_copies): Properly handle case when MODE is narrower than that
of X.
(simplify_shift_const): Remove change of July 26.

From-SVN: r5110
1993-08-08 17:31:39 -04:00
Richard Kenner
6139ff2019 (force_to_mode): Now pass actual AND mask instead of number off;
generalize appropriately.
Move most cases from simplify_and_const_int in.
(simplify_and_const_int): Remove most code from here; call force_to_mode
instead.
(subst, make_extraction, make_compound_operation): Change calls to
force_to_mode.
(make_field_assignment): Likewise.
(simplify_comparison): Add call to force_to_mode when doing a sign bit
comparison.

From-SVN: r5060
1993-08-03 17:31:46 -04:00
Richard Stallman
f5393ab90a (struct undo): Rename rtx' fields to r'.
(undo_all, SUBST, gen_rtx_combine): Corresponding changes.

From-SVN: r5059
1993-08-03 21:27:41 +00:00
Richard Kenner
5109d49f79 (subst): Move simple operations inside IF_THEN_ELSE if the IF_THEN_ELSE is in the second operand as well as the first.
(subst): Move simple operations inside IF_THEN_ELSE if the IF_THEN_ELSE is in
the second operand as well as the first.
(subst, case NEG): Use plus_constant to make a PLUS.
(subst, case MINUS): Simplify (minus 1 (comparison foo bar)).
(subst, case EQ): Add a number of missing cases where comparisons may be
replaced with arithmetic or logical ops.
(subst, case IF_THEN_ELSE): Handle (if_then_else COND (OP Z C1) Z) in a more
general manner.
(simplify_and_const_int): Make AND with gen_binary in case we can simplify it.

From-SVN: r5056
1993-08-02 18:52:56 -04:00
Richard Kenner
0d4d42c365 Remove change of July 21.
(this_basic_block): New variable.
(combine_instructions): Set it.
(try_combine, distribute_links): Use it and basic_block_head to see if
we've gone to a new basic block instead of trying to reproduce
calculation done in flow.

From-SVN: r5044
1993-07-30 06:47:51 -04:00
Richard Stallman
437b3c097d (simplify_shift_const): Inhibit hacks based on
num_sign_bit_copies if shift_mode differs from the mode of varop.

From-SVN: r4994
1993-07-26 22:16:16 +00:00
Jim Wilson
ca5c3ef417 (nonlocal_label_list): New variable.
(combine_instructions): Set it.
(try_combine, distribute_links): CALL_INSN terminates a basic
block if nonlocal_label_list is set.

From-SVN: r4960
1993-07-21 14:44:07 -07:00
Richard Kenner
fe2db4fb68 Add prototypes for static functions.
(subst, case IF_THEN_ELSE): Add missing arg to make_compound_operation.
(make_compound_operation, case ASHIFTRT): Delete extra gen_unary arg.

From-SVN: r4945
1993-07-20 15:06:35 -04:00
Richard Stallman
9c3b4c8be3 Include stdio.h before rtl.h.
From-SVN: r4884
1993-07-09 05:09:25 +00:00
Jim Wilson
34785d0514 (simplify_comparison): Add parentheses to satify gcc.
From-SVN: r4877
1993-07-07 15:03:52 -07:00
Jim Wilson
5c0e109149 (simplify_and_const_int, LSHIFTRT case): Must be at
least as many sign bit copies as bits in mask.

From-SVN: r4868
1993-07-06 14:21:40 -07:00
Richard Kenner
bc0776c620 (subst, case PLUS): Simplify (plus (comp A B) -1), etc.
From-SVN: r4853
1993-07-05 17:56:42 -04:00
Richard Stallman
c070dcf733 comment change.
From-SVN: r4797
1993-06-29 22:05:11 +00:00
Richard Kenner
3ad2180a02 (subst, apply_distributive_law): Use INTEGRAL_MODE_P and FLOAT_MODE_P.
(reversible_comparison_p): Likewise.
Can reverse if MODE_COMPLEX_INT or MODE_PARTIAL_INT.

From-SVN: r4779
1993-06-27 21:19:42 -04:00