(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
(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
(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
(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
(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
(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
(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