RFR(M): 8196402: AARCH64: create intrinsic for Math.log

Dmitrij Pochepko dmitrij.pochepko at bell-sw.com
Mon May 21 13:55:33 UTC 2018

Hi all,

please review patch for 8196402: AARCH64: create intrinsic for Math.log

This patch adds Math.log intrinsic to AARCH64. Algorithm is based on a 
table-based search logic such as described in paper [1]. Algorithm 
splits argument in 2 parts (exponent-based and mantissa-based), 
calculate reciprocal estimate of mantissa part and finds reduced 
argument value using pregenerated table, then calculates final value 
using 7th degree polynomial of reduced argument.

This patch heavily uses vector calculations. Few previously 
unimplemented vector instructions are added to support it.

Performance results:

I created separate JMH benchmark: 

Benchmark results for logarithm (intrinsic vs without intrinsics (shared 

ThunderX: x1.37 improvement

ThunderX2: x1.33 improvement

Cortex A73: x1.2 improvement

Cortex A53: x1.6 improvement

Detailed results can be checked here: 

webrev: http://cr.openjdk.java.net/~dpochepk/8196402/webrev.01/

CR: https://bugs.openjdk.java.net/browse/JDK-8196402

Testing: I launched jtreg jdk tests for Math.log: jdk/java/lang/Math/Log*

I also launched jck tests for Math.log:

All tests were launched both in Xcomp and Xmixed modes, using release 
and fastdebug builds.

No failures found.

Additional tests are not required because the algorithm is already 
present in hotspot for x86.



[1] Table-driven implementation of the logarithm function in IEEE 
floating-point arithmetic (https://dl.acm.org/citation.cfm?doid=98267.98294)

More information about the hotspot-compiler-dev mailing list