[10] RFR(S): 8187684 - Intrinsify Math.multiplyHigh(long, long)

Dmitrij Pochepko dmitrij.pochepko at bell-sw.com
Wed Sep 20 13:08:27 UTC 2017


please review small patch for enhancement: 8187684 - Intrinsify 
Math.multiplyHigh(long, long)

Method Math.multiplyHigh was introduced in jdk9 and is not intrinsified. 
This patch adds such intrinsic by using existing MulHiLNode. For aarch64 
and x86_64 it uses respective cpu instruction (smulh/mulq), which is faster.

I've created a small JMH benchmark: 
http://cr.openjdk.java.net/~dpochepk/8187684/MultiplyHighBench.java to 
test the improved performance and measured it on aarch64(t88, R-Pi) and 
x86_64(i7-4770K). Benchmark shows about x2.5 improvement on aarch64 and 
about x2 on x86_64

Detailed benchmark results are here: 

webrev hotspot: 

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

I've found existing jtreg test for multiplyHigh in 
jdk/test/java/lang/Math which covers this method. I've run it in -Xmixed 
and -Xcomp modes and found no regressions.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20170920/5042f67b/attachment.html>

More information about the hotspot-compiler-dev mailing list