Math trig intrinsics and compiler options

gustav trede gustav.trede at gmail.com
Fri Aug 7 03:19:00 PDT 2009


2009/8/7 Christian Thalinger <Christian.Thalinger at sun.com>

> gustav trede wrote:
> > When i tested with b67 the current hotspot does not manage to remove
> > that object allocation by using cpu registers, even on 64 bit jvm with
> > its many registers available.
> > Also breaking up some very large methods into several smaller is a
> > general nice thing to do regarding both performance and OO design.
>
> And how is the performance compared to the current implementation?
>
> -- Christian
>

That implementation has done some optimizations that causes loss of
accuracy:
sin  Double.longBitsToDouble(0xc01921fb54442d18L)   should give
Double.longBitsToDouble(0x3cb1a62633145c07L)   but it fails with 285703
ulps.
It also seems to never complete for for some input values,   cos
1.7976931348623157E308   is one example.

There are working java implementations, one is:
http://www-sop.inria.fr/oasis/ProActive2/doc/release-doc/ProActive_src_html/org/objectweb/proactive/examples/profractal/JMath.java.html

That one at least passes my informal tests, matching current strictmath
results exactly for billions of values regarding cos, sin at least.
performance difference depends heavily on platform, i will remove the
double[] y usage and compare with the current solaris version, that seems to
be the fastest one.


-- 
regards
 gustav trede
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20090807/b7f5a519/attachment.html 


More information about the hotspot-dev mailing list