aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>1994-11-16 21:10:09 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>1994-11-16 21:10:09 +0000
commitf76b9db2874507ed287d1fe39ca2b1e89ae95207 (patch)
tree036743ae971e4dddc0469a67fd6d6272b0801af8 /gcc/real.h
parent1942e820686abbdd62515895e219476c26429945 (diff)
downloadgcc-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.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/real.h b/gcc/real.h
index 34d6d67..4242641 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -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 */