Commit Graph

387 Commits

Author SHA1 Message Date
Jim Wilson
5970d32e6e (store_bit_field, extract_bit_field): Consistently use
SLOW_UNALIGNED_ACCESS instead of STRICT_ALIGNMENT.

From-SVN: r8568
1994-11-28 16:58:04 -08:00
Jim Wilson
03f3609810 (expand_shift): Re-enable truncation of immediate shift count.
From-SVN: r8527
1994-11-19 15:37:10 -08:00
Ian Lance Taylor
f76b9db287 Check target endianness at run time, not compile time
From-SVN: r8470
1994-11-16 21:10:09 +00:00
Richard Kenner
69f619018a (expand_divmod, case ROUND_DIV_EXPR): Implement.
From-SVN: r8442
1994-11-15 16:50:23 -05:00
Richard Kenner
e80316129f (expand_divmod, case TRUNC_DIV_EXPR): Promote signed division by
0x80000000 to unsigned.

From-SVN: r8430
1994-11-12 06:35:09 -05:00
Richard Kenner
73f277280f (expand_divmod): Special case for signed CEIL_DIV_EXPR when divisor is
power of 2.

From-SVN: r8123
1994-09-22 18:56:08 -04:00
Jim Wilson
485fafaa15 (store_split_bit_field): Use number of bits in arg not
BITS_PER_WORD to adjust arg in BYTES_BIG_ENDIAN case.

From-SVN: r8086
1994-09-15 10:45:25 -07:00
Per Bothner
ad83e87b61 expmed.c (store_bit_field): Semi-revert Aug 25 change: Make it apply only for BLKmode, not integral modes.
* expmed.c (store_bit_field):  Semi-revert Aug 25 change:
Make it apply only for BLKmode, not integral modes.

From-SVN: r8007
1994-08-31 16:29:53 -07:00
Richard Kenner
4db3bddcbe (store_split_bit_field): Always adjust arg to extract_fixed_bit_field
in BYTES_BIG_ENDIAN case.

From-SVN: r8005
1994-08-31 18:54:44 -04:00
Per Bothner
556a4cb2c9 Always store into multi-word bitfields starting with low addresses.
From-SVN: r7985
1994-08-25 17:15:35 -07:00
Jim Wilson
ceb1d26880 (expand_mult): Accept DImode for synth_mult only if CONST_DOUBLE_HIGH is zero.
(expand_mult): Accept DImode for synth_mult only if
CONST_DOUBLE_HIGH is zero.  Reject negative values for synth_mult
if the mode is larger than HOST_BITS_PER_INT.  Don't do the
negate_variant if the mode is larger than HOST_BITS_PER_INT.

From-SVN: r7860
1994-08-05 09:29:21 -07:00
Richard Kenner
39e0911f45 ({store,extract}_bit_field): Don't use bitfield insn if OP0 is
register and bitfield spans it.

From-SVN: r7837
1994-07-30 18:09:27 -04:00
Richard Kenner
98310eaac7 (expand_mult): Properly set ADD_TARGET for add_variant.
From-SVN: r7802
1994-07-27 23:33:05 -04:00
Richard Kenner
4e430df869 (expand_divmod): Don't make REG_NOTE if last insn's destination isn't
QUOTIENT.

From-SVN: r7798
1994-07-27 14:06:24 -04:00
Torbjorn Granlund
412381d963 (expand_divmod, case CEIL_DIV_EXPR): Handle emit_store_flag returning 0.
From-SVN: r7768
1994-07-13 20:55:07 +00:00
Doug Evans
4ee16841d4 (extract_split_bit_field): Set UNIT to BITS_PER_WORD for register values.
(store_split_bit_field): Likewise.  Call operand_subword_force.

From-SVN: r7684
1994-07-08 21:16:01 +00:00
Richard Kenner
5b0ce75844 (expand_mult_highpart): Build constant forms of CNST1 in MODE or
WIDE_MODE, as appropriate.

From-SVN: r7676
1994-07-07 22:19:57 -04:00
Torbjorn Granlund
515dfc7a23 (expand_divmod): Clear out TARGET also if OP1 is a constant,
when TARGET == OP0.

From-SVN: r7661
1994-07-06 07:20:48 +00:00
Torbjorn Granlund
9176af2fd8 (expand_divmod): Fix typo setting op1_is_pow2.
(expand_divmod): Handle powers-of-two specifically for CEIL_*_EXPR.

From-SVN: r7658
1994-07-05 23:19:00 +00:00
Torbjorn Granlund
c8dbc8ca7f (expand_divmod): Always return gen_lowpart (mode, ...).
From-SVN: r7640
1994-07-02 13:33:56 +00:00
Torbjorn Granlund
ab0b65811b (expand_divmod): Put OP0 in a register when computing
remainder, or when OP1 is constant.

From-SVN: r7628
1994-07-01 11:40:45 +00:00
Richard Kenner
e9c1141151 (expand_divmod): Don't set REG_NOTES unless we generated a quotient.
From-SVN: r7627
1994-07-01 06:45:56 -04:00
Torbjorn Granlund
55c2d311c4 (expand_mult): Generalize to call synth_mult also for OP1 - 1.
(ceil_log2): New function.
(choose_multiplier): New function.
(invert_mod2n): New function.
(expand_mult_highpart_adjust): New function.
(expand_mult_highpart): New function.
(EXACT_POWER_OF_2_OR_ZERO_P): New macro.
(expand_divmod): Almost completely rewritten.
(expand_shift): Don't truncate immediate shift count, it doesn't work
for types smaller than int.

From-SVN: r7598
1994-06-29 00:23:02 +00:00
Richard Kenner
711a5e64b8 (expand_shift): Don't try extzv for lshr.
From-SVN: r7514
1994-06-18 10:31:51 -04:00
Richard Kenner
4c9a05bc55 Cast pointer operands to bzero, bcopy, and bcmp to (char *).
From-SVN: r7472
1994-06-14 18:19:28 -04:00
Richard Kenner
7831ef177b (expand_divmod): Correctly set CAN_CLOBBER_OP0 when we've converted OP0
to COMPUTE_MODE.

From-SVN: r7349
1994-05-26 11:55:34 -04:00
Jim Wilson
2305bcadd5 (store_fixed_bit_field): Delete code to handle MODE_FLOAT values here.
(store_fixed_bit_field): Delete code to handle
MODE_FLOAT values here.
(store_bit_field): Put it here instead.

From-SVN: r7279
1994-05-11 14:50:11 -07:00
Richard Kenner
82c68a7824 Add prototypes for static functions.
From-SVN: r7118
1994-04-21 15:31:56 -04:00
Richard Kenner
a34958c911 (expand_shift): No longer reference lshl_optab.
From-SVN: r7022
1994-04-10 08:04:35 -04:00
Jim Wilson
5f57dff07b (store_split_bit_field): If OP0 is a SUBREG, then compute WORD from the base register, instead of from the SUBREG.
(store_split_bit_field): If OP0 is a SUBREG, then
compute WORD from the base register, instead of from the SUBREG.
(extract_split_bit_field): Likewise.
(extract_bit_field): Sign-extend multiword bitfield if necessary.

From-SVN: r6668
1994-02-27 16:55:33 -08:00
Jim Wilson
3bd98790b0 (store_fixed_bit_field): Adjust BITPOS so that it
fits inside MODE before adjusting OFFSET to get an aligned address.

From-SVN: r6658
1994-02-27 14:46:49 -08:00
Jim Wilson
a5f00f07f1 (store_fixed_bit_field): Move float mode to integral
mode conversion from near end of function to top of function.

From-SVN: r6657
1994-02-27 14:44:49 -08:00
Torbjorn Granlund
2ab0a5c41c (expand_shift): Truncate immediate count if SHIFT_COUNT_TRUNCATED.
From-SVN: r6538
1994-02-12 12:40:58 +00:00
Doug Evans
bac7cdfd7d (store_bit_field, insv case): Don't use PUT_MODE on
xop0 when it is a SUBREG, generate a new SUBREG.

From-SVN: r6478
1994-02-03 22:14:46 +00:00
Richard Kenner
52786026fa (synth_mult): Delay allocation of algorithm structures until they are needed.
(synth_mult): Delay allocation of algorithm structures until they are
needed.  Reorder early-exit tests to avoid comparing value that is not
yet set.

From-SVN: r6464
1994-02-02 13:24:14 -05:00
Jim Wilson
bc8a0e39b7 (store_split_bit_field): Reject gen_lowpart_common
output if it returns the input value.

From-SVN: r6430
1994-01-24 16:33:14 -08:00
Jim Wilson
9033081d38 (store_split_bit_field): For BYTES_BIG_ENDIAN, only
pad on left if value not in memory.

From-SVN: r6429
1994-01-24 16:24:18 -08:00
Richard Kenner
c0a085741f (expand_mult): Preserve useful sub-expressions when
expanding a synthesized mult.

From-SVN: r6287
1993-12-23 18:27:51 -05:00
Richard Stallman
3d709ff063 (store_split_bit_field): Properly load a constant VALUE
into a WORD_MODE pseudo.

From-SVN: r6092
1993-11-15 01:55:03 +00:00
Richard Stallman
29d40fa4d8 (expand_divmod): If rem_flag, always force op0 to a register.
From-SVN: r6053
1993-11-10 21:28:27 +00:00
Richard Stallman
937aa51bba (expand_divmod): Use target as copy_to_suggested_reg
argument only if it has the same mode as op0.

From-SVN: r5984
1993-11-03 20:24:18 +00:00
Torbjorn Granlund
c0b262c166 (synth_mult): When factoring T, break from loop after first factor.
(expand_mult): Increase max cost to 12 again.

From-SVN: r5961
1993-11-01 11:18:32 +00:00
Richard Stallman
b348776522 (store_bit_field): When calling operand_subword_force,
if VALUE has a non-void mode, pass that mode.

From-SVN: r5939
1993-10-30 06:04:18 +00:00
Richard Stallman
d4c6dfec80 (init_expmed): Use register 10000, not FIRST_PSEUDO_REGISTER that gets special treatment in rtx_cost.
(init_expmed): Use register 10000, not FIRST_PSEUDO_REGISTER
that gets special treatment in rtx_cost.
(expand_mult): Decrease max cost to 8.

From-SVN: r5897
1993-10-26 17:39:52 +00:00
Richard Kenner
e10f6dd1a9 (expand_divmod): Create RESULT in proper mode when trying
quotient-and-remainder insn.

From-SVN: r5862
1993-10-21 13:48:04 -04:00
Richard Stallman
733484b5d6 (extract_split_bit_field): Change shift count calculation
in little-endian case.

From-SVN: r5794
1993-10-18 20:17:08 +00:00
Richard Stallman
c2ec26b8af (expand_shift): Use convert_modes.
(emit_store_flag): Likewise.

From-SVN: r5309
1993-09-12 12:51:14 +00:00
Richard Stallman
81722fa979 (emit_store_flag, expand_divmod): Use convert_modes.
From-SVN: r5295
1993-09-09 19:19:51 +00:00
Richard Kenner
4b46230e9d (make_tree, case CONST_INT): Properly set high part if unsigned.
From-SVN: r5280
1993-09-08 06:15:49 -04:00
Jeff Law
bd5d175ab8 expmed.c (store_bit_field): Do not use bitfield instructions for STRICT_ALIGNMENT machines if...
* expmed.c (store_bit_field): Do not use bitfield instructions for
	STRICT_ALIGNMENT machines if the MEM's alignment isn't as big as
	the MEM's mode.

From-SVN: r5213
1993-08-25 17:38:10 -06:00
Richard Stallman
c7e33f8937 (SLOW_UNALIGNED_ACCESS): Define, but allow override.
(store_bit_field): Test that instead of STRICT_ALIGNMENT.
Also, allow fetching as non-bitfield if memory is aligned enough.
(extract_bit_field): Install code here like that in store_bit_field.

From-SVN: r5131
1993-08-11 05:22:55 +00:00
Richard Kenner
bc1c7e9300 (expand_divmod): Clean up code and documentation, especially in areas
related to when copies are made.

From-SVN: r5098
1993-08-07 07:43:53 -04:00
Richard Kenner
819126a607 (mult_is_very_cheap): Delete.
(mult_cost): Delete.
(init_expmed): Delete computation of mult_cost and mult_is_very_cheap.
(expand_mult): Compute mult_cost here for every constant multiplier.
(synth_mult): Return found algorithms through a struct pointer.

From-SVN: r5045
1993-07-30 06:49:23 -04:00
Doug Evans
0eb61c19ed expmed.c (store_split_bitfield): Fix handling of bitfields that cross word boundaries...
* expmed.c (store_split_bitfield): Fix handling of bitfields that
 cross word boundaries, can only handle a word at a time.
 (extract_split_bitfield): Likewise.

From-SVN: r5012
1993-07-28 16:39:07 +00:00
Richard Stallman
06c94bceeb (store_split_bit_field, extract_split_bit_field):
Handle fields split across more than 2 aligned units.

From-SVN: r4840
1993-07-05 03:30:59 +00:00
Richard Stallman
e49a094d25 (MAX_BITS_PER_WORD): Define earlier.
(shift_cost, shiftadd_cost, shiftsub_cost): Use MAX_BITS_PER_WORD.

From-SVN: r4657
1993-06-10 17:00:40 +00:00
Torbjorn Granlund
63610db99b (synth_mult): Move code to add or subtract at leftmost 1-bit to before...
(synth_mult): Move code to add or subtract at
leftmost 1-bit to before factoring code to decrease the allowed cost
quickly.  Restrict it to handle only odd numbers.
(init_expmed): Limit mult_cost to make synth_mult run faster.

From-SVN: r4636
1993-06-05 09:52:14 +00:00
Richard Stallman
172a1cb0ef (init_expmed): Supply missing arg to rtx_cost.
From-SVN: r4385
1993-05-08 19:32:22 +00:00
Richard Kenner
e54d80d014 (store_split_bit_field): Properly handle VALUE when it is a
CONST_DOUBLE.

From-SVN: r4354
1993-05-06 05:47:46 -04:00
Jim Wilson
401db79156 (extract_fixed_bit_field): Adjust BITPOS so that it
fits inside MODE before adjusting OFFSET to get an aligned address.

From-SVN: r4216
1993-04-25 14:07:22 -07:00
Richard Stallman
f2dd837227 (expand_divmod): When adjusting op0 for trunc_div or trunc_mod...
(expand_divmod): When adjusting op0 for trunc_div or
trunc_mod, using shifts (not branches), make a new pseudo for the
result.  Don't use target for adjusted_op0.

From-SVN: r4081
1993-04-11 08:08:54 +00:00
Torbjorn Granlund
dac57de003 (init_expmed): Fix typo in last change.
From-SVN: r3801
1993-03-20 16:22:37 +00:00
Richard Kenner
5eebe2eb03 (synth_mult): Don't try to make recursive call if we would be shifting by a negative number.
(synth_mult): Don't try to make recursive call if we would be shifting
by a negative number.
(expand_mult): Don't negate VAL if it is negative.

From-SVN: r3788
1993-03-19 17:30:21 -05:00
Richard Kenner
b385aeda3f (zero_cost): New variable.
(init_expmed): Always pass some insn to recog.
Set shift_cost[0], shiftadd_cost[0] and shiftsub_cost[0] to something
reasonable.
Compute zero_cost.
(enum alg_code): Remove alg_none; add alg_zero and alg_m.
(struct algorithm): Rename field COEFF to LOG.
(synth_mult): Use new ops alg_zero and alg_m for multiplication by zero and
one, respectively.
Use MIN when helpful.
Be consistent and don't test cost before recursive call.
Don't special-case shift counts of zero; already handled elsewhere.
(expand_mult): First operation is always alg_zero or alg_m; remaining
operations can't be one of those.
Use proper subtargets for computations.
Remove special-cases for shift counts of zero.
Track value computed so far and make REG_EQUAL notes.

From-SVN: r3786
1993-03-19 06:27:23 -05:00
Richard Kenner
b2fb324cbf (lea_max_mul): Delete.
(init_expmed): Delete unused variable I.
(enum alg_code): New tag alg_shift.  Document it.
(synth_mult): Delete unused variable N.  Handle new trivial case
first, for T <= 1.  Generalize shifting code to shift whenever a
number is even; use alg_shift for this.  Set best_alg->ops only in
trivial case.  Clean up cost calculation code for the `simple case' at
the end; use shiftadd_cost when appropriate.  Combine declarations of
Q and move to top of function.  Eliminate use of Q in factoring cases.
If we are getting too long a sequence for `struct algorithm' to
record, fail.
(expand_mult): Handle alg_shift instead of alg_add_t_m2 as first
operation.  In RLT emit loop, handle alg_shift; special case LOG == 0
for alg_add_t_m2 and alg_sub_t_m2.

From-SVN: r3750
1993-03-15 18:38:07 -05:00
Richard Kenner
7963ac373a (shift_cost): Now a vector.
(shiftadd_cost): New vector for cost of (N * a + b) instructions.
(shiftsub_cost): New vector for cost of (N * a - b) instructions.
(lea_cost): Removed.
(init_expmed): Initialize new vectors.  Use ASHIFT, not LSHIFT.
Remove code initializing lea_cost.
(enum alg_code): New definition.
(synth_mult): Rewrite for better algorithms and faster operation.
(expand_mult): Rewrite code for constant multiplication.

From-SVN: r3735
1993-03-14 21:26:55 -05:00
Richard Kenner
c8c1bde3bb (emit_store_flag): Fix typo in testing BRANCH_COST.
From-SVN: r3533
1993-02-25 17:52:02 -05:00
Richard Stallman
522ae84c3d (emit_store_flag): Add missing arg to convert_move.
From-SVN: r3437
1993-02-08 04:34:45 +00:00
Richard Kenner
c2615a67c7 (emit_store_flag): Swap operands if first is a constant and second is not.
Abort if compare_from_rtx didn't return an rtx with the code we expect.

From-SVN: r3371
1993-01-27 19:23:02 -05:00
Richard Stallman
8deb7047a6 (emit_store_flag): Reset ICODE using returned COMPARISON.
From-SVN: r3315
1993-01-24 00:03:35 +00:00
Richard Kenner
cbec710efc (expand_shift): If rotating by a constant, try both directions of rotate...
(expand_shift): If rotating by a constant, try both directions of
rotate; if can't open-code a rotate, do it as a pair of shifts
followed by an IOR.

From-SVN: r2971
1992-12-28 06:07:52 -05:00
Richard Stallman
f5df292efc (store_bit_field): If VALUE needs to be narrowed, do
it with gen_lowpart, not an explicit SUBREG.

From-SVN: r2920
1992-12-27 03:55:29 +00:00
Richard Stallman
3b2f07926a (struct algorithm): Make coeff a HOST_WIDE_INT.
From-SVN: r2806
1992-11-26 15:34:10 +00:00
Richard Kenner
2c414fba8e (expand_mult): Bound second synth_mult cost by cost of algorithm from
first call.

(expand_divmod): When doing logical operations, the size of
COMPUTE_MODE should be used, not MODE.

From-SVN: r1869
1992-08-17 07:34:23 -04:00
Tom Wood
3d32ffd13f (expand_divmod): Eliminate the generation of branches
when possible.

From-SVN: r1687
1992-07-25 10:14:05 +00:00
Richard Stallman
b3d4e1b2a1 (expand_shift, expand_set_flag):
Call protect_from_queue before convert_to_mode.

From-SVN: r1606
1992-07-17 04:24:33 +00:00
Charles Hannum
b1ec3c9262 entered into RCS
From-SVN: r1472
1992-07-06 20:04:10 +00:00
Richard Kenner
4b980e20ad *** empty log message ***
From-SVN: r1318
1992-06-28 06:10:54 -04:00
Richard Stallman
d8064a5d0a *** empty log message ***
From-SVN: r1101
1992-05-27 20:52:20 +00:00
Richard Kenner
c2a47e48d5 *** empty log message ***
From-SVN: r1045
1992-05-22 06:33:37 -04:00
Richard Stallman
66c1f88e8e *** empty log message ***
From-SVN: r1007
1992-05-18 05:34:36 +00:00
Richard Stallman
b7a091350e *** empty log message ***
From-SVN: r979
1992-05-14 21:37:58 +00:00
Richard Stallman
56a2f04910 *** empty log message ***
From-SVN: r787
1992-04-19 01:16:25 +00:00
Richard Stallman
aeedc93fba *** empty log message ***
From-SVN: r779
1992-04-18 19:40:49 +00:00
Richard Kenner
717702e6ae *** empty log message ***
From-SVN: r680
1992-04-04 04:43:06 -05:00
Richard Stallman
36d747f619 *** empty log message ***
From-SVN: r573
1992-03-23 02:16:03 +00:00
Torbjorn Granlund
44037a668c Initial revision
From-SVN: r401
1992-03-06 19:37:23 +00:00