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:
Chuck Rasbold 2008-10-14 06:58:58 -07:00
parent e585263735
commit 0dac6431d2
2 changed files with 21 additions and 6 deletions

View file

@ -152,6 +152,14 @@ const Type *MulNode::Value( PhaseTransform *phase ) const {
if( t1 == Type::BOTTOM || t2 == Type::BOTTOM )
return bottom_type();
#if defined(IA32)
// Can't trust native compilers to properly fold strict double
// multiplication with round-to-zero on this platform.
if (op == Op_MulD && phase->C->method()->is_strict()) {
return TypeD::DOUBLE;
}
#endif
return mul_ring(t1,t2); // Local flavor of type multiplication
}
@ -360,7 +368,7 @@ const Type *MulFNode::mul_ring(const Type *t0, const Type *t1) const {
// Compute the product type of two double ranges into this node.
const Type *MulDNode::mul_ring(const Type *t0, const Type *t1) const {
if( t0 == Type::DOUBLE || t1 == Type::DOUBLE ) return Type::DOUBLE;
// We must be adding 2 double constants.
// We must be multiplying 2 double constants.
return TypeD::make( t0->getd() * t1->getd() );
}