This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How do I expand a move immediate into two RTL expressions?
- From: Ian Lance Taylor <ian at airs dot com>
- To: "Tabony, Charles" <ctabony at qualcomm dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: 13 Jul 2005 13:38:09 -0700
- Subject: Re: How do I expand a move immediate into two RTL expressions?
- References: <EB1E62A76BB79847916C729925C820CE55616D@NAEX06.na.qualcomm.com>
"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