mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 20:44:41 +02:00
6717150: improper constant folding of subnormal strictfp multiplications and divides
Suppress constant folding of double divides and multiplications on ia32 Reviewed-by: never
This commit is contained in:
parent
e585263735
commit
0dac6431d2
2 changed files with 21 additions and 6 deletions
|
@ -710,11 +710,18 @@ const Type *DivDNode::Value( PhaseTransform *phase ) const {
|
|||
if( t2 == TypeD::ONE )
|
||||
return t1;
|
||||
|
||||
// If divisor is a constant and not zero, divide them numbers
|
||||
if( t1->base() == Type::DoubleCon &&
|
||||
t2->base() == Type::DoubleCon &&
|
||||
t2->getd() != 0.0 ) // could be negative zero
|
||||
return TypeD::make( t1->getd()/t2->getd() );
|
||||
#if defined(IA32)
|
||||
if (!phase->C->method()->is_strict())
|
||||
// Can't trust native compilers to properly fold strict double
|
||||
// division with round-to-zero on this platform.
|
||||
#endif
|
||||
{
|
||||
// If divisor is a constant and not zero, divide them numbers
|
||||
if( t1->base() == Type::DoubleCon &&
|
||||
t2->base() == Type::DoubleCon &&
|
||||
t2->getd() != 0.0 ) // could be negative zero
|
||||
return TypeD::make( t1->getd()/t2->getd() );
|
||||
}
|
||||
|
||||
// If the dividend is a constant zero
|
||||
// Note: if t1 and t2 are zero then result is NaN (JVMS page 213)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue