RFR: 8371459: [REDO] AArch64: Use SHA3 GPR intrinsic where it's faster
Boris Ulasevich
bulasevich at openjdk.org
Mon Dec 8 20:32:07 UTC 2025
This change revises a previous update to enable the SHA3 GPR intrinsic as an alternative to the SHA3 extension–based intrinsic on platforms where it performs better. In practice, it is enabled only on Apple and Qualcomm silicon. See the previous PR for measurement details: https://github.com/openjdk/jdk/pull/27726
Tests were updated accordingly: now UseSHA3Intrinsics can be enabled on AArch64 even without the SHA3 CPU capability.
The test TestUseSHA3IntrinsicsOptionOnSupportedCPU.java was also enabled on AMD as this platform supports the intrinsic.
TestUseSHA3IntrinsicsOptionOnSupportedCPU verifies that UseSHA3Intrinsics can only be enabled when UseSHA is enabled. This follows the behavior of other SHA options and the option description, see globals.hpp:
product(bool, UseSHA3Intrinsics, false, DIAGNOSTIC, \
"Use intrinsics for SHA3 crypto hash function. " \
"Requires that UseSHA is enabled.") \
- the x86 implementation was updated to match this behavior.
I did not like the message _"Intrinsics for SHA3-224, SHA3-256, SHA3-384 and SHA3-512 crypto hash functions not available on this CPU"_ to be printed when the VM is started with `-XX:-UseSHA -XX:+UseSHA3Intrinsics`. Instead, it now prints _"UseSHA3Intrinsics requires that UseSHA is enabled"_ for this specific case, and the test was updated to check only for the presence of "warning:" in the output. I decided not to apply the same change for UseSHA1Intrinsics, UseSHA256Intrinsics, and UseSHA512Intrinsics on AArch64 and x86 to keep the modification minimal. Please let me know if you think these should be updated as well.
Testing on platforms
- AMD (machines with and without SHA3 CPU capability)
- AARCH (Apple CPU and Neoverse machines with and without SHA3 CPU capability)
-------------
Commit messages:
- 8359256: AArch64: Use SHA3 GPR intrinsic where it's faster
Changes: https://git.openjdk.org/jdk/pull/28515/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28515&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8371459
Stats: 45 lines in 9 files changed: 21 ins; 6 del; 18 mod
Patch: https://git.openjdk.org/jdk/pull/28515.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28515/head:pull/28515
PR: https://git.openjdk.org/jdk/pull/28515
More information about the hotspot-dev
mailing list