VM_Version maintains two views of CPU features:
1. features supported by the hardware, referred in the code by "VM_Version::_cpu_features"
2. features enabled in the JVM, referred as "VM_Version::_features"
Naturally second set is a subset of first set. Second set is also affected by some command line flags that can be used by the user to enable/disable use of CPU features by the JVM.
For instance, on intel UseAVX allows user to restrict the JVM to user lower level of AVX level, even if the hardware supports higher level. In such cases JVM disables the bits corresponding to the higher level AVX feature in the second set.
However, this pattern is not followed consistently. There are some cases where the CPU feature can be disabled by the user, but it is not reflected in the second set.
This can be problematic for Leyden which is planning to rely on storing the second set in the AOTCodeCache to determine validity of the code in situations where the production run is executed on a different system than the assembly run.
Example of such cases on intel:
UseCLMUL, UseFMA
Example on aarch64:
UseLSE
1. features supported by the hardware, referred in the code by "VM_Version::_cpu_features"
2. features enabled in the JVM, referred as "VM_Version::_features"
Naturally second set is a subset of first set. Second set is also affected by some command line flags that can be used by the user to enable/disable use of CPU features by the JVM.
For instance, on intel UseAVX allows user to restrict the JVM to user lower level of AVX level, even if the hardware supports higher level. In such cases JVM disables the bits corresponding to the higher level AVX feature in the second set.
However, this pattern is not followed consistently. There are some cases where the CPU feature can be disabled by the user, but it is not reflected in the second set.
This can be problematic for Leyden which is planning to rely on storing the second set in the AOTCodeCache to determine validity of the code in situations where the production run is executed on a different system than the assembly run.
Example of such cases on intel:
UseCLMUL, UseFMA
Example on aarch64:
UseLSE