Patch: gcj optimizations
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Wed Oct 17 08:56:00 GMT 2001
Tom Tromey wrote:
>Tom> We could also inline things like Math.sin, Math.cos, etc.
>
>Today I implemented these two, which meant enabling a bunch of builtin
>function stuff. It's a bit ugly. Still, I'm going to send it in when
>my libgcj rebuild/retest is finished.
>
Cool. It would be interesting to see how much of an improvement we get
on the FFT benchmarks in either jbyte or scimark, since they rely on
these functions.
>It turns out that you have to use -funsafe-math-optimizations to get
>sin/cos inlining. I imagine implementing `strictfp' (and there is no
>concrete plan to do so that I'm aware of) will require us to
>generalize bits of gcc in this area. For instance, in a non-strict
>context I imagine we can always inline sin or cos.
>
Does the __builtin_cos etc with -funsafe-math-optimizations handle the
NaN and sign-of-argument cases specified in the docs correctly? If it
doesn't then I think we can't use -funsafe-math-optimizations even for
non-strict Math.* calls. But using __builtin_cos is still a big win
since it will at least use a hardware optimized implementation (and
bypass at least one level of call).
regards
Bryce.
More information about the Java-patches
mailing list