diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-03 08:32:46 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-03 08:32:46 +0000 |
commit | a188bbe7ac5fd8299530c585966f3305bcc3d95b (patch) | |
tree | 2591e777a77646d0bc7a6977ac1e88895bde96c1 /lib/VMCore | |
parent | 1416862d7c9382a58813f0609c4d4d1c858724c8 (diff) | |
download | external_llvm-a188bbe7ac5fd8299530c585966f3305bcc3d95b.zip external_llvm-a188bbe7ac5fd8299530c585966f3305bcc3d95b.tar.gz external_llvm-a188bbe7ac5fd8299530c585966f3305bcc3d95b.tar.bz2 |
Fix constant folding of fp->int bitcast for vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 0d27a88..05a7588 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -86,9 +86,9 @@ static Constant *CastConstantVector(ConstantVector *CV, 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); |