mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-03 19:15:30 +00:00
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
This commit is contained in:
parent
1416862d7c
commit
a188bbe7ac
@ -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