RFR: 8293695: Implement isInfinite intrinsic for RISC-V

Aleksei Voitylov avoitylov at openjdk.org
Tue Sep 13 16:12:57 UTC 2022


RISC-V 64 intrinsic for isInfinite follows the logic of x86 intrinsic (introduced by 8285868). This patch adds C2 match for IsInfinite nodes. Existing test is modified to run on RISC-V and passes on both release and fastdebug builds. Benchmark results are below:

before:
Benchmark                              Mode  Cnt   Score   Error Units
DoubleClassCheck.testIsInfiniteBranch  avgt   15  43.547 ± 6.843 ns/op
DoubleClassCheck.testIsInfiniteCMov    avgt   15  16.301 ± 1.386 ns/op
DoubleClassCheck.testIsInfiniteStore   avgt   15  16.230 ± 1.477 ns/op
FloatClassCheck.testIsInfiniteBranch   avgt   15  38.774 ± 3.572 ns/op
FloatClassCheck.testIsInfiniteCMov     avgt   15  15.064 ± 1.310 ns/op
FloatClassCheck.testIsInfiniteStore    avgt   15  14.967 ± 1.298 ns/op

after:
Benchmark                              Mode  Cnt   Score    Error Units
DoubleClassCheck.testIsInfiniteBranch  avgt   15  39.987 ±  6.179 ns/op
DoubleClassCheck.testIsInfiniteCMov    avgt   15  13.477 ±  1.159 ns/op
DoubleClassCheck.testIsInfiniteStore   avgt   15   9.607 ±  0.834 ns/op
FloatClassCheck.testIsInfiniteBranch   avgt   15  36.265 ±  3.168 ns/op
FloatClassCheck.testIsInfiniteCMov     avgt   15  13.230 ±  1.100 ns/op
FloatClassCheck.testIsInfiniteStore    avgt   15   9.492 ±  0.807 ns/op

According to 8285868 discussion, isNaN and isFinite methods intrinsification using the same approach might be not beneficial. I'm going to investigate it for RISC-V and propose methods intrinsification as part of further work in case it's profitable.

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

Commit messages:
 - JDK-8293695 implementation

Changes: https://git.openjdk.org/jdk/pull/10253/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10253&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8293695
  Stats: 30 lines in 3 files changed: 26 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/10253.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10253/head:pull/10253

PR: https://git.openjdk.org/jdk/pull/10253


More information about the hotspot-compiler-dev mailing list