mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 08:46:37 +00:00
Fix dumb regression in constant folding (Regression/C/casts)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42165 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c20f5b086e
commit
4bf6ac5f40
@ -213,7 +213,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
|
||||
return 0; // Other pointer types cannot be casted
|
||||
case Instruction::UIToFP:
|
||||
if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
|
||||
double d = CI->getValue().signedRoundToDouble();
|
||||
double d = CI->getValue().roundToDouble();
|
||||
if (DestTy==Type::FloatTy)
|
||||
return ConstantFP::get(DestTy, APFloat((float)d));
|
||||
else if (DestTy==Type::DoubleTy)
|
||||
|
Loading…
Reference in New Issue
Block a user