RFR(S):8242429:Better implementation for signed extract
Eric Liu
eric.c.liu at arm.com
Thu Apr 16 04:13:32 UTC 2020
Hi Vladimir,
Thanks for your review.
> One comment:
>
> (i >> 31) >>> 31 ==> i >>> 31
>
> The shift count value is irrelevant here, isn't it?
>
> So, the transformation can be generalized to:
>
> (i >> n) >>> 31 ==> i >>> 31
Yes. This match rule exactly could be more general.
JBS: https://bugs.openjdk.java.net/browse/JDK-8242429
Webrev: http://cr.openjdk.java.net/~yzhang/ericliu/8242429/webrev.01/
[Tests]
Jtreg hotspot::hotspot_all_no_apps, jdk::jdk_core and langtools::tier1.
No new failure found.
JMH: A simple JMH case [1] on AArch64 and AMD64 machines.
For AArch64, one platform has no obvious improvement, but on others the
performance gain is 7.3%~32.7%.
For AMD64, one platform has no obvious improvement, but on others the
performance gain is 13.7%~32.4%.
A simple test case [2] has checked the correctness for some corner
cases.
[1] https://bugs.openjdk.java.net/secure/attachment/87712/IdealNegate.java
[2] https://bugs.openjdk.java.net/secure/attachment/87713/SignExtractTest.java
Thanks,
Eric
More information about the hotspot-compiler-dev
mailing list