RFR: 8352477: RISC-V: Print warnings when unsupported intrinsics are enabled

Feilong Jiang fjiang at openjdk.org
Fri Mar 21 11:09:13 UTC 2025


On Thu, 20 Mar 2025 02:32:18 GMT, Fei Yang <fyang at openjdk.org> wrote:

> Hi, please consider this small change.
> 
> `UsePoly1305Intrinsics`, `UseMD5Intrinsics` and `UseSHA1Intrinsics` depend on `!AvoidUnalignedAccesses` and thus are unavailable on platforms with slow unaligned accesses. But these options could still be enabled on the command line, which I think could be suprising to our end users as these intrinsics will only have negative impact on performance numbers for such platforms. It seems to me more reasonable to print warnings and keep them disabled when enabled by the user on such platforms. After this change, we have:
> 
> 
> ubuntu at premier-p550:~/jdk$ java -XX:+UnlockDiagnosticVMOptions -XX:+UseMD5Intrinsics -version
> OpenJDK 64-Bit Server VM warning: Intrinsics for MD5 crypto hash functions not available on this CPU.
> openjdk version "25-internal" 2025-09-16
> OpenJDK Runtime Environment (build 25-internal-adhoc.ubuntu.jdk)
> OpenJDK 64-Bit Server VM (build 25-internal-adhoc.ubuntu.jdk, mixed mode, sharing)
> 
> ubuntu at premier-p550:~/jdk$ java -XX:+UnlockDiagnosticVMOptions -XX:+UsePoly1305Intrinsics -version
> OpenJDK 64-Bit Server VM warning: Intrinsics for Poly1305 crypto hash functions not available on this CPU.
> openjdk version "25-internal" 2025-09-16
> OpenJDK Runtime Environment (build 25-internal-adhoc.ubuntu.jdk)
> OpenJDK 64-Bit Server VM (build 25-internal-adhoc.ubuntu.jdk, mixed mode, sharing)
> 
> ubuntu at premier-p550:~/jdk$ java -XX:+UnlockDiagnosticVMOptions -XX:+UseSHA1Intrinsics -version
> OpenJDK 64-Bit Server VM warning: Intrinsics for SHA-1 crypto hash functions not available on this CPU.
> openjdk version "25-internal" 2025-09-16
> OpenJDK Runtime Environment (build 25-internal-adhoc.ubuntu.jdk)
> OpenJDK 64-Bit Server VM (build 25-internal-adhoc.ubuntu.jdk, mixed mode, sharing)

Looks good.

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

Marked as reviewed by fjiang (Committer).

PR Review: https://git.openjdk.org/jdk/pull/24123#pullrequestreview-2705546961


More information about the hotspot-compiler-dev mailing list