aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/xtensa
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2008-09-20 02:43:00 +0000
committerBob Wilson <bwilson@gcc.gnu.org>2008-09-20 02:43:00 +0000
commit398857e4fbe5915a0d9a946ed6db4ac5c693ed77 (patch)
treeff9f821e0e23d2986a52e6fb3299e96b6ce63238 /gcc/config/xtensa
parentb680c09618a98b0c6ab79d54b37590b9fecd70b1 (diff)
downloadgcc-398857e4fbe5915a0d9a946ed6db4ac5c693ed77.zip
gcc-398857e4fbe5915a0d9a946ed6db4ac5c693ed77.tar.gz
gcc-398857e4fbe5915a0d9a946ed6db4ac5c693ed77.tar.bz2
* config/xtensa/xtensa.md (reload<mode>_literal): Handle MEM operands.
From-SVN: r140509
Diffstat (limited to 'gcc/config/xtensa')
-rw-r--r--gcc/config/xtensa/xtensa.md19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 29119ed..abaf29d 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -898,13 +898,22 @@
rtx lit, scratch;
unsigned word_off, byte_off;
- gcc_assert (GET_CODE (operands[1]) == SUBREG);
- lit = SUBREG_REG (operands[1]);
- scratch = operands[2];
- word_off = SUBREG_BYTE (operands[1]) & ~(UNITS_PER_WORD - 1);
- byte_off = SUBREG_BYTE (operands[1]) - word_off;
+ if (MEM_P (operands[1]))
+ {
+ lit = operands[1];
+ word_off = 0;
+ 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);
+ scratch = operands[2];
emit_insn (gen_movsi (scratch, lit));
emit_insn (gen_mov<mode> (operands[0],
gen_rtx_SUBREG (<MODE>mode, scratch, byte_off)));