8296426: x86: Narrow UseAVX and UseSSE flags

Reviewed-by: vlivanov, kvn
This commit is contained in:
Claes Redestad 2022-11-08 23:41:50 +00:00
parent 8146e1af82
commit d9b25e860b
4 changed files with 14 additions and 14 deletions

View file

@ -106,13 +106,13 @@ define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
product(bool, UseStoreImmI16, true, \ product(bool, UseStoreImmI16, true, \
"Use store immediate 16-bits value instruction on x86") \ "Use store immediate 16-bits value instruction on x86") \
\ \
product(intx, UseSSE, 99, \ product(int, UseSSE, 4, \
"Highest supported SSE instructions set on x86/x64") \ "Highest supported SSE instructions set on x86/x64") \
range(0, 99) \ range(0, 4) \
\ \
product(intx, UseAVX, 3, \ product(int, UseAVX, 3, \
"Highest supported AVX instructions set on x86/x64") \ "Highest supported AVX instructions set on x86/x64") \
range(0, 99) \ range(0, 3) \
\ \
product(bool, UseKNLSetting, false, DIAGNOSTIC, \ product(bool, UseKNLSetting, false, DIAGNOSTIC, \
"Control whether Knights platform setting should be used") \ "Control whether Knights platform setting should be used") \

View file

@ -404,8 +404,8 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
// Generate SEGV here (reference through NULL) // Generate SEGV here (reference through NULL)
// and check upper YMM/ZMM bits after it. // and check upper YMM/ZMM bits after it.
// //
intx saved_useavx = UseAVX; int saved_useavx = UseAVX;
intx saved_usesse = UseSSE; int saved_usesse = UseSSE;
// If UseAVX is uninitialized or is set by the user to include EVEX // If UseAVX is uninitialized or is set by the user to include EVEX
if (use_evex) { if (use_evex) {
@ -900,7 +900,7 @@ void VM_Version::get_processor_features() {
if (FLAG_IS_DEFAULT(UseSSE)) { if (FLAG_IS_DEFAULT(UseSSE)) {
FLAG_SET_DEFAULT(UseSSE, use_sse_limit); FLAG_SET_DEFAULT(UseSSE, use_sse_limit);
} else if (UseSSE > use_sse_limit) { } else if (UseSSE > use_sse_limit) {
warning("UseSSE=%d is not supported on this CPU, setting it to UseSSE=%d", (int) UseSSE, use_sse_limit); warning("UseSSE=%d is not supported on this CPU, setting it to UseSSE=%d", UseSSE, use_sse_limit);
FLAG_SET_DEFAULT(UseSSE, use_sse_limit); FLAG_SET_DEFAULT(UseSSE, use_sse_limit);
} }
@ -930,9 +930,9 @@ void VM_Version::get_processor_features() {
} }
if (UseAVX > use_avx_limit) { if (UseAVX > use_avx_limit) {
if (UseSSE < 4) { if (UseSSE < 4) {
warning("UseAVX=%d requires UseSSE=4, setting it to UseAVX=0", (int) UseAVX); warning("UseAVX=%d requires UseSSE=4, setting it to UseAVX=0", UseAVX);
} else { } else {
warning("UseAVX=%d is not supported on this CPU, setting it to UseAVX=%d", (int) UseAVX, use_avx_limit); warning("UseAVX=%d is not supported on this CPU, setting it to UseAVX=%d", UseAVX, use_avx_limit);
} }
FLAG_SET_DEFAULT(UseAVX, use_avx_limit); FLAG_SET_DEFAULT(UseAVX, use_avx_limit);
} }
@ -1860,9 +1860,9 @@ void VM_Version::get_processor_features() {
log->print_cr("Logical CPUs per core: %u", log->print_cr("Logical CPUs per core: %u",
logical_processors_per_package()); logical_processors_per_package());
log->print_cr("L1 data cache line size: %u", L1_data_cache_line_size()); log->print_cr("L1 data cache line size: %u", L1_data_cache_line_size());
log->print("UseSSE=%d", (int) UseSSE); log->print("UseSSE=%d", UseSSE);
if (UseAVX > 0) { if (UseAVX > 0) {
log->print(" UseAVX=%d", (int) UseAVX); log->print(" UseAVX=%d", UseAVX);
} }
if (UseAES) { if (UseAES) {
log->print(" UseAES=1"); log->print(" UseAES=1");

View file

@ -232,7 +232,7 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
do_uintx_flag(TLABWasteIncrement) \ do_uintx_flag(TLABWasteIncrement) \
do_intx_flag(TypeProfileWidth) \ do_intx_flag(TypeProfileWidth) \
do_bool_flag(UseAESIntrinsics) \ do_bool_flag(UseAESIntrinsics) \
X86_ONLY(do_intx_flag(UseAVX)) \ X86_ONLY(do_int_flag(UseAVX)) \
do_bool_flag(UseCRC32Intrinsics) \ do_bool_flag(UseCRC32Intrinsics) \
do_bool_flag(UseAdler32Intrinsics) \ do_bool_flag(UseAdler32Intrinsics) \
do_bool_flag(UseCompressedClassPointers) \ do_bool_flag(UseCompressedClassPointers) \
@ -252,7 +252,7 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
do_bool_flag(UseSHA1Intrinsics) \ do_bool_flag(UseSHA1Intrinsics) \
do_bool_flag(UseSHA256Intrinsics) \ do_bool_flag(UseSHA256Intrinsics) \
do_bool_flag(UseSHA512Intrinsics) \ do_bool_flag(UseSHA512Intrinsics) \
X86_ONLY(do_intx_flag(UseSSE)) \ X86_ONLY(do_int_flag(UseSSE)) \
COMPILER2_PRESENT(do_bool_flag(UseSquareToLenIntrinsic)) \ COMPILER2_PRESENT(do_bool_flag(UseSquareToLenIntrinsic)) \
do_bool_flag(UseTLAB) \ do_bool_flag(UseTLAB) \
do_bool_flag(VerifyOops) \ do_bool_flag(VerifyOops) \

View file

@ -82,7 +82,7 @@ public class NaNTest {
// native methods that use FPU instructions, and those strip the // native methods that use FPU instructions, and those strip the
// signaling NaNs. // signaling NaNs.
if (Platform.isX86()) { if (Platform.isX86()) {
int sse = WHITE_BOX.getIntxVMFlag("UseSSE").intValue(); int sse = WHITE_BOX.getIntVMFlag("UseSSE").intValue();
expectStableFloats = (sse >= 1); expectStableFloats = (sse >= 1);
expectStableDoubles = (sse >= 2); expectStableDoubles = (sse >= 2);
} }