mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 03:06:28 +00:00
Fix constant folding of fp->int bitcast for vectors.
llvm-svn: 34880
This commit is contained in:
parent
36fb227e99
commit
6037b564a0
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user