[llvm-commits] CVS: llvm/lib/VMCore/ConstantFold.cpp

Reid Spencer reid at x10sys.com
Sat Mar 3 00:33:13 PST 2007



Changes in directory llvm/lib/VMCore:

ConstantFold.cpp updated: 1.146 -> 1.147
---
Log message:

Fix constant folding of fp->int bitcast for vectors.


---
Diffs of the changes:  (+2 -2)

 ConstantFold.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/VMCore/ConstantFold.cpp
diff -u llvm/lib/VMCore/ConstantFold.cpp:1.146 llvm/lib/VMCore/ConstantFold.cpp:1.147
--- llvm/lib/VMCore/ConstantFold.cpp:1.146	Thu Mar  1 18:28:52 2007
+++ llvm/lib/VMCore/ConstantFold.cpp	Sat Mar  3 02:32:46 2007
@@ -86,9 +86,9 @@
     
     if (SrcEltTy->getTypeID() == Type::DoubleTyID) {
       for (unsigned i = 0; i != SrcNumElts; ++i) {
-        double V =
+        uint64_t V =
           DoubleToBits(cast<ConstantFP>(CV->getOperand(i))->getValue());
-        Constant *C = ConstantInt::get(APIntOps::RoundDoubleToAPInt(V));
+        Constant *C = ConstantInt::get(Type::Int64Ty, V);
         Result.push_back(ConstantExpr::getBitCast(C, DstEltTy ));
       }
       return ConstantVector::get(Result);






More information about the llvm-commits mailing list