summaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>1994-11-16 21:10:09 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>1994-11-16 21:10:09 +0000
commit51356f864933f664f7dfbf6e25ddcd97b587441a (patch)
tree036743ae971e4dddc0469a67fd6d6272b0801af8 /gcc/real.h
parentd70e58b6facc61184689890af429c7f0def003e8 (diff)
downloadgcc-51356f864933f664f7dfbf6e25ddcd97b587441a.tar.gz
Check target endianness at run time, not compile time
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8470 138bc75d-0d04-0410-961f-82ee72b054a4
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 34d6d678389..424264196e6 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 */