RFR: 8251216: Implement MD5 intrinsics on AArch64

Claes Redestad redestad at openjdk.java.net
Wed Dec 1 15:36:25 UTC 2021


On Wed, 1 Dec 2021 09:24:45 GMT, Patric Hedlin <phedlin at openjdk.org> wrote:

> Implementation of MD5 intrinsic support for AArch64.
> 
> Contributed by Ludovic Henry (@luhenry).
> 
> Speedup measured (in Aurora running Ampere Altra) as follows:
> 
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:1048576-provider:...29.39%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:2047-provider:.........28.91%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:2048-provider:.........28.81%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:1023-provider:.........28.43%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:1024-provider:.........28.32%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:511-provider:...........27.78%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:512-provider:...........27.62%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:255-provider:...........26.52%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:256-provider:...........26.38%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:127-provider:...........25.41%
> openjdk.bench.javax.crypto.full.MessageDigestBench.digest-algorithm:MD5-dataSize:128-provider:...........24.66%
> 
> Testing tier1-7.

While I think it's good that distributions are free to omit MD5 now, there's still various non-cryptographic uses that warrant continued support and enhancements. Checksumming, JDK APIs such as `UUID.nameUUIDFromBytes`, etc.. Perhaps there should be a build flag to omit all of this, though?

For startup it remains a sore point that stubs like these are generated eagerly on bootstrap. I hope we'll be able to make this lazy in the near future ([JDK-8231349](https://bugs.openjdk.java.net/browse/JDK-8231349)) to make adding intrinsics come with fewer trade-offs. This particular stub is very simple and likely adds unnoticably to bootstrap, but in accumulation it's grown to be a bit of a concern in places, especially on x86 with large AVX-512 intrinsics. I'm not sure if there's been any progress on this recently, though. @vnkozlov?

(I'm not qualified to review Aarch64 code, but this contribution looks ok to me.)

-------------

PR: https://git.openjdk.java.net/jdk/pull/6628


More information about the hotspot-compiler-dev mailing list