RFR(S): 8230591: AArch64: Missing intrinsics for Math.ceil, floor, rint

Pengfei Li Pengfei.Li at arm.com
Thu Jan 9 09:36:21 UTC 2020


Hi,

JBS: https://bugs.openjdk.java.net/browse/JDK-8230591
Webrev: http://cr.openjdk.java.net/~pli/rfr/8230591/webrev.00/

This patch adds missing intrinsics for Math.ceil, floor and rint on AArch64 with Instructions FRINTP, FRINTM and FRINTN, respectively. These 3 instructions respect to the Java API Spec of the 3 math methods quite well, especially for special cases such as +/-0.0, +/-Inf and NaN.

This also adds vectorized forms of these intrinsics. Intel has already added jtreg [1] and benchmark [2] for these intrinsics in its x86 patch [3].

Tests:
Jtreg: no new failure after my change.
JMH FpRoundingBenchmark.java[2]:
(Before)
  Benchmark                      (TESTSIZE)   Mode  Cnt    Score   Error   Units
  FpRoundingBenchmark.testceil         1024  thrpt   15  255.867 ± 0.123  ops/ms
  FpRoundingBenchmark.testfloor        1024  thrpt   15  249.013 ± 0.118  ops/ms
  FpRoundingBenchmark.testrint         1024  thrpt   15  419.425 ± 5.868  ops/ms
(After)
  Benchmark                      (TESTSIZE)   Mode  Cnt     Score   Error   Units
  FpRoundingBenchmark.testceil         1024  thrpt   15  1510.861 ± 2.626  ops/ms
  FpRoundingBenchmark.testfloor        1024  thrpt   15  1510.289 ± 6.147  ops/ms
  FpRoundingBenchmark.testrint         1024  thrpt   15  1510.780 ± 1.091  ops/ms


[1] https://hg.openjdk.java.net/jdk/jdk/file/b94889c7e153/test/hotspot/jtreg/compiler/c2/cr6340864/TestDoubleVect.java
[2] https://hg.openjdk.java.net/jdk/jdk/file/b94889c7e153/test/micro/org/openjdk/bench/java/math/FpRoundingBenchmark.java
[3] https://hg.openjdk.java.net/jdk/jdk/rev/6fc57e391539

--
Thanks,
Pengfei



More information about the hotspot-compiler-dev mailing list