mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 00:16:25 +00:00
Fix the construction of the magic constant for roundToIntegral to be 64-bit safe. Fixes c-torture/execute/990826-0.c
llvm-svn: 161885
This commit is contained in:
parent
b5970fe958
commit
0db4c468c5
@ -1774,8 +1774,8 @@ APFloat::opStatus APFloat::roundToIntegral(roundingMode rounding_mode) {
|
||||
// precision of our format, and then subtract it back off again. The choice
|
||||
// of rounding modes for the addition/subtraction determines the rounding mode
|
||||
// for our integral rounding as well.
|
||||
APInt IntegerConstant(NextPowerOf2(semanticsPrecision(*semantics)),
|
||||
1 << (semanticsPrecision(*semantics)-1));
|
||||
APInt IntegerConstant(NextPowerOf2(semanticsPrecision(*semantics)), 1);
|
||||
IntegerConstant <<= semanticsPrecision(*semantics)-1;
|
||||
APFloat MagicConstant(*semantics);
|
||||
fs = MagicConstant.convertFromAPInt(IntegerConstant, false,
|
||||
rmNearestTiesToEven);
|
||||
|
Loading…
Reference in New Issue
Block a user