RFR: 8351902: RISC-V: Several tests fail after JDK-8351145
Robbin Ehn
rehn at openjdk.org
Tue Mar 18 14:52:10 UTC 2025
On Tue, 18 Mar 2025 12:22:00 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.
Yes, I got the test wrong. Thank @Hamlin-Li explaining it to me.
I'm fine with just disabling it, as we basically need to predicate on AvoidUnalignedAccesses.
Which in its turn is a predicate for UseMD5Instrinsic.
So did we even test anything ? That is not clear to me and if there was something tested it seems to be of very little value.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24027#issuecomment-2733524844
More information about the hotspot-compiler-dev
mailing list