[aarch64-port-dev ] RFR(M): 8212043: Add floating-point Math.min/max intrinsics

Pengfei Li (Arm Technology China) Pengfei.Li at arm.com
Fri Oct 19 09:57:13 UTC 2018


Hi Andrew, 

> Thanks for this. It looks right, but I'd like to see JMH test results.
Here is a small JMH case to test the performance gain. Code can be found at http://cr.openjdk.java.net/~pli/rfr/8212043/TestFpMinMaxIntrinsics.java
Please see below table for test results (JMH avg. score) on different servers when the intrinsics are turned off/on.

    CPU             -XX:-InlineMathNatives     -XX:+InlineMathNatives
E5-2660 (x86)            407.377 ops/s              391.917 ops/s
softiron                 157.661 ops/s              338.389 ops/s
qdf2400                  369.771 ops/s              863.014 ops/s
thunderX                  70.536 ops/s              164.009 ops/s
thunderX2                145.814 ops/s              338.293 ops/s
huawei-D02               173.471 ops/s              399.399 ops/s
huawei-D05               168.032 ops/s              604.316 ops/s

> > Also, do we need an intrinsic? What happens to the performance if you
> > try to match a pattern such as
> >
> > (a <=  b) ? a : b
> 
> Ah, this would be wrong to covert to the min instruction because of NaN
> handling, wouldn't it? Forget that idea, then. Thanks.
Yes, because of the NaN handling, this kind of patterns cannot be done with fmax/fmin instructions.

--
Thanks,
Pengfei


More information about the hotspot-compiler-dev mailing list