Math trig intrinsics and compiler options

Christian Thalinger Christian.Thalinger at Sun.COM
Thu Jul 16 08:12:03 PDT 2009


Azeem Jiva wrote:
> Joe,
>   Gustav sent me an email asking for help with the intrinsification of
> the trig functions and a suggestion I gave him was to not call
> fsin/fcos/ftan since those instructions are microcoded on Intel/AMD
> hardware and very slow.  Slower than the call to
> sharedRuntimeTrig.cpp, and in all cases it's best to stay away from
> the hardware instructions.

I just did some micro-benchmarking on an Intel Core2 Duo and in the
range of [0,2pi) inlining the hardware instructions is slightly faster
(about 2.5%).  Limiting the range to [0,pi/4) (means no runtime calls)
hardware instructions are 1.5x faster.

I think we should keep the current approach.

-- Christian



More information about the hotspot-dev mailing list