RFR: 8265491: Math Signum optimization for x86

Jatin Bhateja jbhateja at openjdk.java.net
Tue Apr 20 08:41:07 UTC 2021


On Mon, 19 Apr 2021 23:00:47 GMT, Marcus G K Williams <github.com+168222+mgkwill at openjdk.org> wrote:

> x86 Math.Signum() uses two floating point compares and a copy sign operation involving data movement to gpr and XMM.
> 
> We can optimize to one floating point compare and sign computation in XMM. We observe ~25% performance improvement with this optimization.
> 
> Base:
> Benchmark Mode Cnt Score Error Units
> Signum._1_signumFloatTest avgt 5 4.660 ? 0.040 ns/op
> Signum._3_signumDoubleTest avgt 5 4.809 ? 0.043 ns/op
>  
> Optimized:
> signum intrinsic patch
> Benchmark Mode Cnt Score Error Units
> Signum._1_signumFloatTest avgt 5 3.782 ? 0.019 ns/op
> Signum._3_signumDoubleTest avgt 5 3.782 ? 0.017 ns/op
> 
> Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>

@mgkwill,  your newly added benchmark has 4 micro worklets, please publish the results for all of them.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3581


More information about the hotspot-compiler-dev mailing list