How do I expand a move immediate into two RTL expressions?

Ian Lance Taylor ian@airs.com
Wed Jul 13 20:38:00 GMT 2005


"Tabony, Charles" <ctabony@qualcomm.com> writes:

>       emit_move_insn(gen_rtx_SUBREG(HImode, operands[0], 2),
>                      GEN_INT((INTVAL(operands[1]) >> 16) & 0xFFFF));
>       emit_move_insn(gen_rtx_SUBREG(HImode, operands[0], 0),
>                      GEN_INT(INTVAL(operands[1]) & 0xFFFF));

Integer constants in sub UNITS_PER_WORD modes should normally be sign
extended.  Use
    trunc_int_for_mode (INTVAL (operands[1]) >> 16, HImode)
and similarly for the other operand.

Incidentally, this kind of question may be better asked on
gcc@gcc.gnu.org, although there is nothing wrong with using gcc-help.

Ian



More information about the Gcc-help mailing list