Commit 398857e4 by Bob Wilson Committed by Bob Wilson

* config/xtensa/xtensa.md (reload<mode>_literal): Handle MEM operands.

From-SVN: r140509
parent b680c096
2008-09-19 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.md (reload<mode>_literal): Handle MEM operands.
2008-09-19 Ian Lance Taylor <iant@google.com> 2008-09-19 Ian Lance Taylor <iant@google.com>
* varasm.c (narrowing_initializer_constant_valid_p): Return * varasm.c (narrowing_initializer_constant_valid_p): Return
......
...@@ -898,13 +898,22 @@ ...@@ -898,13 +898,22 @@
rtx lit, scratch; rtx lit, scratch;
unsigned word_off, byte_off; unsigned word_off, byte_off;
gcc_assert (GET_CODE (operands[1]) == SUBREG); if (MEM_P (operands[1]))
lit = SUBREG_REG (operands[1]); {
scratch = operands[2]; lit = operands[1];
word_off = SUBREG_BYTE (operands[1]) & ~(UNITS_PER_WORD - 1); word_off = 0;
byte_off = SUBREG_BYTE (operands[1]) - word_off; byte_off = 0;
}
else
{
gcc_assert (GET_CODE (operands[1]) == SUBREG);
lit = SUBREG_REG (operands[1]);
word_off = SUBREG_BYTE (operands[1]) & ~(UNITS_PER_WORD - 1);
byte_off = SUBREG_BYTE (operands[1]) - word_off;
}
lit = adjust_address (lit, SImode, word_off); lit = adjust_address (lit, SImode, word_off);
scratch = operands[2];
emit_insn (gen_movsi (scratch, lit)); emit_insn (gen_movsi (scratch, lit));
emit_insn (gen_mov<mode> (operands[0], emit_insn (gen_mov<mode> (operands[0],
gen_rtx_SUBREG (<MODE>mode, scratch, byte_off))); gen_rtx_SUBREG (<MODE>mode, scratch, byte_off)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment