diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 1994-11-16 21:10:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 1994-11-16 21:10:09 +0000 |
commit | f76b9db2874507ed287d1fe39ca2b1e89ae95207 (patch) | |
tree | 036743ae971e4dddc0469a67fd6d6272b0801af8 /gcc/recog.c | |
parent | 1942e820686abbdd62515895e219476c26429945 (diff) | |
download | gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.zip gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.tar.gz gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.tar.bz2 |
Check target endianness at run time, not compile time
From-SVN: r8470
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index a09a1d9..4177e07 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -423,11 +423,10 @@ validate_replace_rtx_1 (loc, from, to, object) enum machine_mode mode = GET_MODE (x); rtx new; -#if BYTES_BIG_ENDIAN - offset += (MIN (UNITS_PER_WORD, - GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) - - MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))); -#endif + if (BYTES_BIG_ENDIAN) + offset += (MIN (UNITS_PER_WORD, + GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) + - MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))); new = gen_rtx (MEM, mode, plus_constant (XEXP (to, 0), offset)); MEM_VOLATILE_P (new) = MEM_VOLATILE_P (to); @@ -474,10 +473,9 @@ validate_replace_rtx_1 (loc, from, to, object) /* If the bytes and bits are counted differently, we must adjust the offset. */ -#if BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN - offset = (GET_MODE_SIZE (is_mode) - GET_MODE_SIZE (wanted_mode) - - offset); -#endif + if (BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN) + offset = (GET_MODE_SIZE (is_mode) - GET_MODE_SIZE (wanted_mode) + - offset); pos %= GET_MODE_BITSIZE (wanted_mode); @@ -1083,10 +1081,9 @@ indirect_operand (op, mode) register int offset = SUBREG_WORD (op) * UNITS_PER_WORD; rtx inner = SUBREG_REG (op); -#if BYTES_BIG_ENDIAN - offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (op))) - - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (inner)))); -#endif + if (BYTES_BIG_ENDIAN) + offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (op))) + - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (inner)))); if (mode != VOIDmode && GET_MODE (op) != mode) return 0; |