[llvm-commits] [llvm-gcc-4.2] r49981 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386.cpp llvm-convert.cpp
Chris Lattner
sabre at nondot.org
Sat Apr 19 17:52:58 PDT 2008
Author: lattner
Date: Sat Apr 19 19:52:58 2008
New Revision: 49981
URL: http://llvm.org/viewvc/llvm-project?rev=49981&view=rev
Log:
migrate to simpler API for ConstantFP creation.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=49981&r1=49980&r2=49981&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Sat Apr 19 19:52:58 2008
@@ -398,7 +398,7 @@
}
case IX86_BUILTIN_LOADQ: {
PointerType *f64Ptr = PointerType::getUnqual(Type::DoubleTy);
- Value *Zero = ConstantFP::get(Type::DoubleTy, APFloat(0.0));
+ Value *Zero = Constant::getNullValue(Type::DoubleTy);
Ops[0] = Builder.CreateBitCast(Ops[0], f64Ptr, "tmp");
Ops[0] = Builder.CreateLoad(Ops[0], "tmp");
Result = BuildVector(Ops[0], Zero, NULL);
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=49981&r1=49980&r2=49981&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Apr 19 19:52:58 2008
@@ -5727,8 +5727,7 @@
if (llvm::sys::bigEndianHost() != FLOAT_WORDS_BIG_ENDIAN)
std::swap(UArr[0], UArr[1]);
- return ConstantFP::get(Ty, Ty==Type::FloatTy ? APFloat((float)V)
- : APFloat(V));
+ return ConstantFP::get(Ty==Type::FloatTy ? APFloat((float)V) : APFloat(V));
} else if (Ty==Type::X86_FP80Ty) {
long RealArr[4];
uint64_t UArr[2];
@@ -5739,7 +5738,7 @@
((uint64_t)((uint16_t)(RealArr[0] >> 16)));
UArr[1] = (uint16_t)RealArr[0];
- return ConstantFP::get(Ty, APFloat(APInt(80, 2, UArr)));
+ return ConstantFP::get(APFloat(APInt(80, 2, UArr)));
} else if (Ty==Type::PPC_FP128Ty) {
long RealArr[4];
uint64_t UArr[2];
@@ -5749,7 +5748,7 @@
((uint64_t)((uint32_t)RealArr[1]));
UArr[1] = ((uint64_t)((uint32_t)RealArr[2]) << 32) |
((uint64_t)((uint32_t)RealArr[3]));
- return ConstantFP::get(Ty, APFloat(APInt(128, 2, UArr)));
+ return ConstantFP::get(APFloat(APInt(128, 2, UArr)));
}
assert(0 && "Floating point type not handled yet");
return 0; // outwit compiler warning
More information about the llvm-commits
mailing list