RFR: 8351902: RISC-V: Several tests fail after JDK-8351145
Hamlin Li
mli at openjdk.org
Tue Mar 18 12:24:06 UTC 2025
On Thu, 13 Mar 2025 08:57:48 GMT, Hamlin Li <mli at openjdk.org> wrote:
> Hi,
> Can you help to review this simple patch?
> These client tests seems not that useful to me, so the simple solution could be just disable them on riscv.
>
> Thanks!
I think these tests are to verify the crypto intrinsics to be enable based on only CPU features.
For these failed tests, they depends on no cpu feature, but `AvoidUnalignedAccesses`, so we should skip them.
For the tests such as `TestUseSHA256IntrinsicsOptionOnSupportedCPU` and `TestUseSHA512IntrinsicsOptionOnSupportedCPU`, they depends on CPU feature `zvkn`, so they run successfully.
We could modify the test framework to support passing `AvoidUnalignedAccesses` as `unsupportedCPUFeatures`, but seems to me it's not worth to do so, something like below:
--- a/test/hotspot/jtreg/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java
+++ b/test/hotspot/jtreg/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java
@@ -61,7 +61,7 @@ public class IntrinsicPredicates {
public static final BooleanSupplier MD5_INSTRUCTION_AVAILABLE
= new OrPredicate(new CPUSpecificPredicate("aarch64.*", null, null),
- new OrPredicate(new CPUSpecificPredicate("riscv64.*", null, null),
+ new OrPredicate(new CPUSpecificPredicate("riscv64.*", null, new String[] { "AvoidUnalignedAccesses" }),
// x86 variants
new OrPredicate(new CPUSpecificPredicate("amd64.*", null, null),
new OrPredicate(new CPUSpecificPredicate("i386.*", null, null),
@@ -70,7 +70,7 @@ public class IntrinsicPredicates {
public static final BooleanSupplier SHA1_INSTRUCTION_AVAILABLE
= new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha1" }, null),
// SHA-1 intrinsic is implemented with scalar instructions on riscv64
- new OrPredicate(new CPUSpecificPredicate("riscv64.*", null, null),
+ new OrPredicate(new CPUSpecificPredicate("riscv64.*", null, new String[] { "AvoidUnalignedAccesses" }),
new OrPredicate(new CPUSpecificPredicate("s390.*", new String[] { "sha1" }, null),
// x86 variants
new OrPredicate(new CPUSpecificPredicate("amd64.*", new String[] { "sha" }, null),
So, I'll add some comment about why we disable these tests on riscv.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24027#issuecomment-2733028463
More information about the hotspot-compiler-dev
mailing list