review (S) for 6849984: Value methods for platform dependent math functions constant fold incorrectly

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Thu Jan 14 11:34:25 PST 2010

On Jan 14, 2010, at 11:19 AM, Christian Thalinger wrote:

> On Thu, 2010-01-14 at 09:45 -0800, Vladimir Kozlov wrote:
>>> Maybe I missed the point of this change, but why are we using the much
>>> more complicated C versions for these?
>>> +     // The intrinsic version of these seem to return the same value as
>>> +     // the strict version.
>>> +     StubRoutines::_intrinsic_exp = SharedRuntime::dexp;
>>> +     StubRoutines::_intrinsic_pow = SharedRuntime::dpow;
>> There is no implementation of ExpD and PowD in (which is surprise - we missed it???)
>> And it is also complex code - see it in
> Tom just explained it to me on the phone (I try to summarize):  What I
> missed is that these new intrinsics are used in the compiler to do
> constant folding and aren't used during runtime.

The basic rule is that if the VM provides an intrinsic version of the Math functions that doesn't produce the same answer as the fdlibm code then we have to have the same code in the interpreter and the compiler and any constant folding in the compiler also has to use that code.


> -- Christian

More information about the hotspot-compiler-dev mailing list