expand_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
rtx target, int unsignedp, int max_cost)
{
+ rtx narrow_op1 = gen_int_mode (INTVAL (op1), mode);
enum machine_mode wider_mode;
optab moptab;
rtx tem;
if (mul_highpart_cost[(int) mode] < max_cost)
{
moptab = unsignedp ? umul_highpart_optab : smul_highpart_optab;
- tem = expand_binop (mode, moptab, op0,
- gen_int_mode (INTVAL (op1), mode), target,
+ tem = expand_binop (mode, moptab, op0, narrow_op1, target,
unsignedp, OPTAB_DIRECT);
if (tem)
return tem;
< max_cost))
{
moptab = unsignedp ? smul_highpart_optab : umul_highpart_optab;
- tem = expand_binop (mode, moptab, op0,
- gen_int_mode (INTVAL (op1), mode), target,
+ tem = expand_binop (mode, moptab, op0, narrow_op1, target,
unsignedp, OPTAB_DIRECT);
if (tem)
/* We used the wrong signedness. Adjust the result. */
if (moptab->handlers[(int) wider_mode].insn_code != CODE_FOR_nothing
&& mul_widen_cost[(int) wider_mode] < max_cost)
{
- tem = expand_binop (wider_mode, moptab, op0, op1, 0,
+ tem = expand_binop (wider_mode, moptab, op0, narrow_op1, 0,
unsignedp, OPTAB_WIDEN);
if (tem)
return extract_high_half (mode, tem);
&& (mul_widen_cost[(int) wider_mode]
+ 2 * shift_cost[size-1] + 4 * add_cost < max_cost))
{
- rtx regop1 = force_reg (mode, op1);
- tem = expand_binop (wider_mode, moptab, op0, regop1,
+ tem = expand_binop (wider_mode, moptab, op0, narrow_op1,
NULL_RTX, ! unsignedp, OPTAB_WIDEN);
if (tem != 0)
{