[llvm-commits] [llvm-gcc-4.2] r42206 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Dale Johannesen
dalej at apple.com
Fri Sep 21 13:33:42 PDT 2007
Author: johannes
Date: Fri Sep 21 15:33:42 2007
New Revision: 42206
URL: http://llvm.org/viewvc/llvm-project?rev=42206&view=rev
Log:
Make x87 long double work on big endian host cross build.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=42206&r1=42205&r2=42206&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Sep 21 15:33:42 2007
@@ -5238,20 +5238,16 @@
return ConstantFP::get(Ty, Ty==Type::FloatTy ? APFloat((float)V)
: APFloat(V));
} else if (Ty==Type::X86_FP80Ty) {
- long RealArr[4];
- uint64_t UArr[2];
- REAL_VALUE_TO_TARGET_LONG_DOUBLE(TREE_REAL_CST(exp), RealArr);
-
- if (FLOAT_WORDS_BIG_ENDIAN) {
- // FIXME
- } else {
- UArr[0] = ((uint64_t)((uint16_t)RealArr[2]) << 48) |
- ((uint64_t)((uint32_t)RealArr[1]) << 16) |
- ((uint64_t)((uint16_t)(RealArr[0] >> 16)));
- UArr[1] = (uint16_t)RealArr[0];
+ long RealArr[4];
+ uint64_t UArr[2];
+ REAL_VALUE_TO_TARGET_LONG_DOUBLE(TREE_REAL_CST(exp), RealArr);
+
+ UArr[0] = ((uint64_t)((uint16_t)RealArr[2]) << 48) |
+ ((uint64_t)((uint32_t)RealArr[1]) << 16) |
+ ((uint64_t)((uint16_t)(RealArr[0] >> 16)));
+ UArr[1] = (uint16_t)RealArr[0];
return ConstantFP::get(Ty, APFloat(APInt(80, 2, UArr)));
- }
}
assert(0 && "Floating point type not handled yet");
return 0; // outwit compiler warning
More information about the llvm-commits
mailing list