operands[4] = gen_lowpart (SImode, operands[1]);
operands[5] = gen_lowpart (SImode, operands[2]);
operands[6] = gen_highpart (SImode, operands[0]);
- operands[7] = gen_highpart (SImode, operands[1]);
+ operands[7] = gen_highpart_mode (SImode, DImode, operands[1]);
#if HOST_BITS_PER_WIDE_INT == 32
if (GET_CODE (operands[2]) == CONST_INT)
{
}
else
#endif
- operands[8] = gen_highpart (SImode, operands[2]);
+ operands[8] = gen_highpart_mode (SImode, DImode, operands[2]);
}")
(define_split
}
else
#endif
- operands[8] = gen_highpart (SImode, operands[2]);
+ operands[8] = gen_highpart_mode (SImode, DImode, operands[2]);
}")
;; LTU here means "carry set"
(ltu:SI (reg:CC_NOOV 100) (const_int 0))))
(set (match_dup 4) (const_int 0))]
"operands[3] = gen_lowpart (SImode, operands[0]);
- operands[4] = gen_highpart (SImode, operands[1]);")
+ operands[4] = gen_highpart_mode (SImode, DImode, operands[1]);")
(define_insn "*addx_extend_sp64"
[(set (match_operand:DI 0 "register_operand" "=r")
{
rtx highp, lowp;
- highp = gen_highpart (SImode, operands[2]);
+ highp = gen_highpart_mode (SImode, DImode, operands[2]);
lowp = gen_lowpart (SImode, operands[2]);
if ((lowp == const0_rtx)
&& (operands[0] == operands[1]))
emit_insn (gen_rtx_SET (VOIDmode,
gen_highpart (SImode, operands[0]),
gen_rtx_MINUS (SImode,
- gen_highpart (SImode, operands[1]),
+ gen_highpart_mode (SImode, DImode,
+ operands[1]),
highp)));
}
else
gen_lowpart (SImode, operands[1]),
lowp));
emit_insn (gen_subx (gen_highpart (SImode, operands[0]),
- gen_highpart (SImode, operands[1]),
+ gen_highpart_mode (SImode, DImode, operands[1]),
highp));
}
DONE;
}
else
#endif
- operands[8] = gen_highpart (SImode, operands[3]);
+ operands[8] = gen_highpart_mode (SImode, DImode, operands[3]);
operands[9] = gen_lowpart (SImode, operands[3]);
}")
abort ();
return result;
}
+
+/* Like gen_highpart_mode, but accept mode of EXP operand in case EXP can
+ be VOIDmode constant. */
+rtx
+gen_highpart_mode (outermode, innermode, exp)
+ enum machine_mode outermode, innermode;
+ rtx exp;
+{
+ if (GET_MODE (exp) != VOIDmode)
+ {
+ if (GET_MODE (exp) != innermode)
+ abort ();
+ return gen_highpart (outermode, exp);
+ }
+ return simplify_gen_subreg (outermode, exp, innermode,
+ subreg_highpart_offset (outermode, innermode));
+}
/* Return offset in bytes to get OUTERMODE low part
of the value in mode INNERMODE stored in memory in target format. */
/* In emit-rtl.c */
extern rtx gen_highpart PARAMS ((enum machine_mode, rtx));
+extern rtx gen_highpart_mode PARAMS ((enum machine_mode,
+ enum machine_mode, rtx));
extern rtx gen_realpart PARAMS ((enum machine_mode, rtx));
extern rtx gen_imagpart PARAMS ((enum machine_mode, rtx));
extern rtx operand_subword PARAMS ((rtx, unsigned int, int,