Mercurial > hg > graal-compiler
comparison src/share/vm/opto/divnode.cpp @ 404:78c058bc5cdc
6717150: improper constant folding of subnormal strictfp multiplications and divides
Summary: suppress constant folding of double divides and multiplications on ia32
Reviewed-by: never
author | rasbold |
---|---|
date | Tue, 14 Oct 2008 06:58:58 -0700 |
parents | cc80376deb0c |
children | bbef4344adb2 |
comparison
equal
deleted
inserted
replaced
403:b744678d4d71 | 404:78c058bc5cdc |
---|---|
708 return TypeD::ONE; | 708 return TypeD::ONE; |
709 | 709 |
710 if( t2 == TypeD::ONE ) | 710 if( t2 == TypeD::ONE ) |
711 return t1; | 711 return t1; |
712 | 712 |
713 // If divisor is a constant and not zero, divide them numbers | 713 #if defined(IA32) |
714 if( t1->base() == Type::DoubleCon && | 714 if (!phase->C->method()->is_strict()) |
715 t2->base() == Type::DoubleCon && | 715 // Can't trust native compilers to properly fold strict double |
716 t2->getd() != 0.0 ) // could be negative zero | 716 // division with round-to-zero on this platform. |
717 return TypeD::make( t1->getd()/t2->getd() ); | 717 #endif |
718 { | |
719 // If divisor is a constant and not zero, divide them numbers | |
720 if( t1->base() == Type::DoubleCon && | |
721 t2->base() == Type::DoubleCon && | |
722 t2->getd() != 0.0 ) // could be negative zero | |
723 return TypeD::make( t1->getd()/t2->getd() ); | |
724 } | |
718 | 725 |
719 // If the dividend is a constant zero | 726 // If the dividend is a constant zero |
720 // Note: if t1 and t2 are zero then result is NaN (JVMS page 213) | 727 // Note: if t1 and t2 are zero then result is NaN (JVMS page 213) |
721 // Test TypeF::ZERO is not sufficient as it could be negative zero | 728 // Test TypeF::ZERO is not sufficient as it could be negative zero |
722 if( t1 == TypeD::ZERO && !g_isnan(t2->getd()) && t2->getd() != 0.0 ) | 729 if( t1 == TypeD::ZERO && !g_isnan(t2->getd()) && t2->getd() != 0.0 ) |