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/real.h | |
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/real.h')
-rw-r--r-- | gcc/real.h | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -260,19 +260,19 @@ do { float f = (float) (IN); \ values which is its bitwise equivalent, but put the two words into proper word order for the target. */ #ifndef REAL_VALUE_TO_TARGET_DOUBLE -#if HOST_FLOAT_WORDS_BIG_ENDIAN == FLOAT_WORDS_BIG_ENDIAN #define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT) \ do { REAL_VALUE_TYPE in = (IN); /* Make sure it's not in a register. */\ - (OUT)[0] = ((long *) &in)[0]; \ - (OUT)[1] = ((long *) &in)[1]; \ + if (HOST_FLOAT_WORDS_BIG_ENDIAN == FLOAT_WORDS_BIG_ENDIAN) \ + { \ + (OUT)[0] = ((long *) &in)[0]; \ + (OUT)[1] = ((long *) &in)[1]; \ + } \ + else \ + { \ + (OUT)[1] = ((long *) &in)[0]; \ + (OUT)[0] = ((long *) &in)[1]; \ + } \ } while (0) -#else -#define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT) \ -do { REAL_VALUE_TYPE in = (IN); /* Make sure it's not in a register. */\ - (OUT)[1] = ((long *) &in)[0]; \ - (OUT)[0] = ((long *) &in)[1]; \ - } while (0) -#endif #endif #endif /* HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT */ |