RFR: 8285868: x86 intrinsics for floating point methods isNaN, isFinite and isInfinite [v9]
Vladimir Kozlov
kvn at openjdk.java.net
Tue May 24 22:04:05 UTC 2022
On Tue, 24 May 2022 20:31:53 GMT, Srinivas Vamsi Parasa <duke at openjdk.java.net> wrote:
>> We develop optimized x86 intrinsics for the floating point class check methods `isNaN()`, `isFinite()` and `IsInfinite()` for Float and Double classes. JMH benchmarks show upto `~70% `improvement using` vfpclasss(s/d)` instructions.
>>
>>
>> Benchmark (ns/op) Baseline Intrinsic(vfpclasss/d) Speedup(%)
>> FloatClassCheck.testIsFinite 0.562 0.406 28%
>> FloatClassCheck.testIsInfinite 0.815 0.383 53%
>> FloatClassCheck.testIsNaN 0.63 0.382 39%
>> DoubleClassCheck.testIsFinite 0.565 0.409 28%
>> DoubleClassCheck.testIsInfinite 0.812 0.375 54%
>> DoubleClassCheck.testIsNaN 0.631 0.38 40%
>> FPComparison.isFiniteDouble 332.638 272.577 18%
>> FPComparison.isFiniteFloat 413.217 331.825 20%
>> FPComparison.isInfiniteDouble 874.897 240.632 72%
>> FPComparison.isInfiniteFloat 872.279 321.269 63%
>> FPComparison.isNanDouble 286.566 240.36 16%
>> FPComparison.isNanFloat 346.123 316.923 8%
>
> Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
>
> - Remove support for non vfpclasss/d based intrinsics
> - Merge branch 'master' of https://git.openjdk.java.net/jdk into float
> - add comment for vfpclasss/d for isFinite()
> - Merge branch 'master' of https://git.openjdk.java.net/jdk into float
> - zero out the upper bits not written by setb
> - use 0x1 to be simpler
> - remove the redundant temp register
> - Split the macros using predicate
> - update jmh tests
> - Merge branch 'master' into float
> - ... and 1 more: https://git.openjdk.java.net/jdk/compare/c1db70d8...70bba0fe
Looks good.
Please, adopt @merykitty suggested changes for micro-benchmarks to include `store, cmove, branch` cases. Show performance results for all of them.
Also adapt your regression tests for all 3 cases too.
I assume `Baseline` data includes #8525 changes. Right?
src/hotspot/share/runtime/vmStructs.cpp line 1847:
> 1845: declare_c2_type(SignumDNode, Node) \
> 1846: declare_c2_type(SignumFNode, Node) \
> 1847: declare_c2_type(IsInfiniteFNode, Node) \
Where are other new nodes?
-------------
PR: https://git.openjdk.java.net/jdk/pull/8459
More information about the hotspot-compiler-dev
mailing list