JDK-8131778 : java disables UseAES flag when using VIS=2 on sparc
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,9
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • CPU: sparc,arm
  • Submitted: 2015-07-17
  • Updated: 2020-02-17
  • Resolved: 2015-11-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u241Fixed 9 b96Fixed openjdk8u242Fixed
Description
There are 2 different behaviors:
x86 and x64:
java -XX:+UseAES -XX:UseSSE=2 -XX:+PrintFlagsFinal -version| grep UseAES
     bool UseAES                                   := true                                {product}
     bool UseAESIntrinsics                          = false                               {product}
java version "1.9.0-ea"
Java(TM) SE Runtime Environment (build 1.9.0-ea-b69)

Intrinsics usage is supported only if SSE version is >2 and UseAES flag is true

sparc: 
java -XX:UseVIS=0 -XX:+UseAES -XX:+PrintFlagsFinal -version | grep UseAES
Java HotSpot(TM) 64-Bit Server VM warning: SPARC AES intrinsics require VIS3 instruction support. Intrinsics will be disabled.
     bool UseAES                                   := false                               {product}
     bool UseAESIntrinsics                          = false                               {product}
java version "1.9.0-ea"
Java(TM) SE Runtime Environment (build 1.9.0-ea-b69)
Intrinsics usage is supported only if VIS version is >2 but useAES flag is false without clear reason

Some code from cpu/sparc/vm/vm_version_sparc.cpp:
 if (has_aes()) {
    if (UseVIS > 2) { // AES intrinsics use MOVxTOd/MOVdTOx which are VIS3
      if (FLAG_IS_DEFAULT(UseAES)) {
        FLAG_SET_DEFAULT(UseAES, true);
      }
      if (FLAG_IS_DEFAULT(UseAESIntrinsics)) {
        FLAG_SET_DEFAULT(UseAESIntrinsics, true);
      }
      // we disable both the AES flags if either of them is disabled on the command line
      if (!UseAES || !UseAESIntrinsics) {
        FLAG_SET_DEFAULT(UseAES, false);
        FLAG_SET_DEFAULT(UseAESIntrinsics, false);
      }
    } else {
        if (UseAES || UseAESIntrinsics) {
          warning("SPARC AES intrinsics require VIS3 instruction support. Intrinsics will be disabled.");
          if (UseAES) {
            FLAG_SET_DEFAULT(UseAES, false);
          }
          if (UseAESIntrinsics) {
            FLAG_SET_DEFAULT(UseAESIntrinsics, false);
          }
        }
    }
Else block here must be reworked to disable useAESIntrinsics, not useAES


Comments
Fix request (8u) I'd like to request an approval to have this bug fix in 8u. This would bring feature parity between OpenJDK and Oracle JDK. Patch does not apply cleanly. A review has been requested here: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2019-November/010633.html
21-11-2019

http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2015-October/019562.html
28-10-2015

ILW=AES flag disabled;sparc w/ aes and UseVIS <=2;none=LMH=>P5
20-07-2015