RFR: 8295698: AArch64: test/jdk/sun/security/ec/ed/EdDSATest.java failed with -XX:+UseSHA3Intrinsics

Dong Bo dongbo at openjdk.org
Mon Nov 14 11:50:27 UTC 2022


On Mon, 14 Nov 2022 09:20:32 GMT, Andrew Haley <aph at openjdk.org> wrote:

> This looks right, but I don't think I can test it, which I usually would do with a patch this complicated. When we have a processor without FEAT_SHA3) we should define BCAX, EOR3, RAX1, and XAR as macros. Could you do that, please?

Thanks for the comments.

Do you mean that we need a patch (not to be merged) to support testing on processor without FEAT_SHA3?
In which, the SHA3 instructions are substituted by multiple instructions, something like: `eor3 v1, v2, v3, v4 => eor v1, v2, v3; eor v1, v1, v4`?

BTW, FEAT_SHA3 is supported on M1. If you happen to have one, the test can be done on it. :)
To test this on M1/MacOS, modification below is needed to enable SHA3Intriniscs by default.
Since other features, i.e. UseSHA, can not be automatically detected neither, I think it is irrelevant with this patch.

--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
@@ -334,15 +334,15 @@ void VM_Version::initialize() {
     FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
   }

- if (UseSHA && VM_Version::supports_sha3()) {
+ // if (UseSHA && VM_Version::supports_sha3()) {
     // Do not auto-enable UseSHA3Intrinsics until it has been fully tested on hardware
- // if (FLAG_IS_DEFAULT(UseSHA3Intrinsics)) {
- // FLAG_SET_DEFAULT(UseSHA3Intrinsics, true);
- // }
- } else if (UseSHA3Intrinsics) {
- warning("Intrinsics for SHA3-224, SHA3-256, SHA3-384 and SHA3-512 crypto hash functions not available on this CPU.");
- FLAG_SET_DEFAULT(UseSHA3Intrinsics, false);
- }
+ if (FLAG_IS_DEFAULT(UseSHA3Intrinsics)) {
+ FLAG_SET_DEFAULT(UseSHA3Intrinsics, true);
+ }
+ //} else if (UseSHA3Intrinsics) {
+ // warning("Intrinsics for SHA3-224, SHA3-256, SHA3-384 and SHA3-512 crypto hash functions not available on this CPU.");
+ // FLAG_SET_DEFAULT(UseSHA3Intrinsics, false);
+ //}

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

PR: https://git.openjdk.org/jdk/pull/10939


More information about the hotspot-compiler-dev mailing list