else if (methods == OPTAB_LIB_WIDEN)
{
/* If we have been unable to open-code this by a rotation,
- do it as the IOR of two shifts. I.e., to rotate A
- by N bits, compute
+ do it as the IOR or PLUS of two shifts. I.e., to rotate
+ A by N bits, compute
(A << N) | ((unsigned) A >> ((-N) & (C - 1)))
- where C is the bitsize of A.
+ where C is the bitsize of A. If N cannot be zero,
+ use PLUS instead of IOR.
It is theoretically possible that the target machine might
not be able to perform either shift and hence we would
temp1 = expand_shift_1 (left ? RSHIFT_EXPR : LSHIFT_EXPR,
mode, shifted, other_amount,
subtarget, 1);
- return expand_binop (mode, ior_optab, temp, temp1, target,
- unsignedp, methods);
+ return expand_binop (mode,
+ CONST_INT_P (op1) ? add_optab : ior_optab,
+ temp, temp1, target, unsignedp, methods);
}
temp = expand_binop (mode,
if (tmp == 0)
return false;
- /* Now OR in the bits carried over from OUTOF_INPUT. */
- if (!force_expand_binop (word_mode, ior_optab, tmp, carries,
+ /* Now OR/PLUS in the bits carried over from OUTOF_INPUT. */
+ if (!force_expand_binop (word_mode, add_optab, tmp, carries,
into_target, unsignedp, methods))
return false;
}
NULL_RTX, unsignedp, next_methods);
if (into_temp1 != 0 && into_temp2 != 0)
- inter = expand_binop (word_mode, ior_optab, into_temp1, into_temp2,
+ inter = expand_binop (word_mode, add_optab, into_temp1, into_temp2,
into_target, unsignedp, next_methods);
else
inter = 0;
NULL_RTX, unsignedp, next_methods);
if (inter != 0 && outof_temp1 != 0 && outof_temp2 != 0)
- inter = expand_binop (word_mode, ior_optab,
+ inter = expand_binop (word_mode, add_optab,
outof_temp1, outof_temp2,
outof_target, unsignedp, next_methods);