return x;
}
+/* Fixup modeless constants to fit required mode. */
+static rtx
+fixup_modeless_constant (rtx x, machine_mode mode)
+{
+ if (GET_MODE (x) == VOIDmode)
+ x = convert_to_mode (mode, x, 1);
+ return x;
+}
+
/* Subroutine of ix86_expand_builtin to take care of binop insns. */
static rtx
if (memory_operand (op, mode))
num_memory++;
+ op = fixup_modeless_constant (op, mode);
+
if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
{
if (optimize || !match || num_memory > 1)
if (VECTOR_MODE_P (mode))
op = safe_vector_operand (op, mode);
+ op = fixup_modeless_constant (op, mode);
+
if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
{
if (optimize || !match)
if (VECTOR_MODE_P (mode))
op = safe_vector_operand (op, mode);
+ op = fixup_modeless_constant (op, mode);
+
if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
op = copy_to_mode_reg (mode, op);
else
op1 = copy_to_mode_reg (Pmode, op1);
if (!insn_data[icode].operand[3].predicate (op2, mode2))
op2 = copy_to_mode_reg (mode2, op2);
+
+ op3 = fixup_modeless_constant (op3, mode3);
+
if (GET_MODE (op3) == mode3 || GET_MODE (op3) == VOIDmode)
{
if (!insn_data[icode].operand[4].predicate (op3, mode3))
if (!insn_data[icode].operand[0].predicate (op0, Pmode))
op0 = copy_to_mode_reg (Pmode, op0);
+ op1 = fixup_modeless_constant (op1, mode1);
+
if (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode)
{
if (!insn_data[icode].operand[1].predicate (op1, mode1))
mode3 = insn_data[icode].operand[3].mode;
mode4 = insn_data[icode].operand[4].mode;
+ op0 = fixup_modeless_constant (op0, mode0);
+
if (GET_MODE (op0) == mode0
|| (GET_MODE (op0) == VOIDmode && op0 != constm1_rtx))
{