This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]