RFR: 8189105: AARCH64: create intrinsic for sin and cos
Dmitrij Pochepko
dmitrij.pochepko at bell-sw.com
Fri Jun 1 13:21:36 UTC 2018
Hi,
please review patch for JDK-8189105: AARCH64: create intrinsic for sin
and cos
This patch adds intrinsics for Math::sin(double) and Math::cos(double).
It implements algorithm for sin and cos from sharedRuntimeTrig.cpp,
which is a variation of classical libm algorithm implementation. Main
difference is in heavy SIMD instructions usage, which shortens
execution. Also few minor optimizations like pipelining instructions,
range-check-based optimizations, optimized constants loading were applied.
Performance:
I created simple benchmark for sin and cos:
http://cr.openjdk.java.net/~dpochepk/8189105/MathBench.java It checks
few values, because of different algorithm branches are taken.
Results summary:
ThunderX2: up to x1.7 improvement
ThunderX: up to x1.4
Cortex A53: up to x1.4
Cortex A73: up to 1.65
Detailed results can be seen here:
http://cr.openjdk.java.net/~dpochepk/8189105/math-sin.xls
Testing: I launched jdk jtreg test for sin/cos functions:
(./test/jdk/java/lang/Math/SinCosCornerCasesTests.java) in both Xmixed
and Xcomp modes
Also I launched respective JCK tests (api/java_lang/Math/sin* and
api/java_lang/Math/cos*) in both Xmixed and Xcomp modes
All passed, no failures found.
webrev: http://cr.openjdk.java.net/~dpochepk/8189105/webrev.01/
CR: https://bugs.openjdk.java.net/browse/JDK-8189105
NOTE: This patch depends on my another patch for Math::log
(JDK-8196402), which adds new instructions into assembler_aarch64.hpp:
frecpe, faddpd, fmlavs, fmlsvs, fmulxvs
Thanks,
Dmitrij
More information about the hotspot-compiler-dev
mailing list