This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bit shifting CQImode values
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 21 Jul 2003 22:36:39 +0930
- Subject: bit shifting CQImode values
This hunk of code I added to calls.c around line 1646 is buggy.
#ifdef BLOCK_REG_PADDING
/* Handle case where we have a value that needs shifting
up to the msb. eg. a QImode value and we're padding
upward on a BYTES_BIG_ENDIAN machine. */
if (nregs == -1)
{
rtx ri = gen_rtx_REG (word_mode, REGNO (reg));
rtx x;
int shift = (UNITS_PER_WORD - size) * BITS_PER_UNIT;
x = expand_binop (word_mode, ashl_optab, mem,
GEN_INT (shift), ri, 1, OPTAB_WIDEN);
if (x != ri)
emit_move_insn (ri, x);
}
The problem being that expand_binop doesn't handle the case when "mem"
is something like (mem/s:CQI (reg/f:DI 118) [0 g1sScc1+0 S2 A8]). I
guess it's not reasonable to expect expand_binop to do what I want here,
and that I need to somehow "flatten" the mem to HImode. Either that,
or load the mem to a CQI reg then change the reg mode. What's the
right way to do this?
--
Alan Modra
IBM OzLabs - Linux Technology Centre