mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-14 17:28:53 +00:00
float->int conversion rounds toward 0. Duh.
Fixes PR1698. llvm-svn: 42273
This commit is contained in:
parent
d005faa65d
commit
4208f4103d
@ -196,7 +196,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
|
||||
uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
|
||||
APFloat::opStatus status = V.convertToInteger(x, DestBitWidth,
|
||||
opc==Instruction::FPToSI,
|
||||
APFloat::rmNearestTiesToEven);
|
||||
APFloat::rmTowardZero);
|
||||
if (status!=APFloat::opOK && status!=APFloat::opInexact)
|
||||
return 0; // give up
|
||||
APInt Val(DestBitWidth, 2, x);
|
||||
|
Loading…
x
Reference in New Issue
Block a user