Skip to content

Commit d9b25e8

Browse files
committed
8296426: x86: Narrow UseAVX and UseSSE flags
Reviewed-by: vlivanov, kvn
1 parent 8146e1a commit d9b25e8

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/hotspot/cpu/x86/globals_x86.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
106106
product(bool, UseStoreImmI16, true, \
107107
"Use store immediate 16-bits value instruction on x86") \
108108
\
109-
product(intx, UseSSE, 99, \
109+
product(int, UseSSE, 4, \
110110
"Highest supported SSE instructions set on x86/x64") \
111-
range(0, 99) \
111+
range(0, 4) \
112112
\
113-
product(intx, UseAVX, 3, \
113+
product(int, UseAVX, 3, \
114114
"Highest supported AVX instructions set on x86/x64") \
115-
range(0, 99) \
115+
range(0, 3) \
116116
\
117117
product(bool, UseKNLSetting, false, DIAGNOSTIC, \
118118
"Control whether Knights platform setting should be used") \

src/hotspot/cpu/x86/vm_version_x86.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
404404
// Generate SEGV here (reference through NULL)
405405
// and check upper YMM/ZMM bits after it.
406406
//
407-
intx saved_useavx = UseAVX;
408-
intx saved_usesse = UseSSE;
407+
int saved_useavx = UseAVX;
408+
int saved_usesse = UseSSE;
409409

410410
// If UseAVX is uninitialized or is set by the user to include EVEX
411411
if (use_evex) {
@@ -900,7 +900,7 @@ void VM_Version::get_processor_features() {
900900
if (FLAG_IS_DEFAULT(UseSSE)) {
901901
FLAG_SET_DEFAULT(UseSSE, use_sse_limit);
902902
} else if (UseSSE > use_sse_limit) {
903-
warning("UseSSE=%d is not supported on this CPU, setting it to UseSSE=%d", (int) UseSSE, use_sse_limit);
903+
warning("UseSSE=%d is not supported on this CPU, setting it to UseSSE=%d", UseSSE, use_sse_limit);
904904
FLAG_SET_DEFAULT(UseSSE, use_sse_limit);
905905
}
906906

@@ -930,9 +930,9 @@ void VM_Version::get_processor_features() {
930930
}
931931
if (UseAVX > use_avx_limit) {
932932
if (UseSSE < 4) {
933-
warning("UseAVX=%d requires UseSSE=4, setting it to UseAVX=0", (int) UseAVX);
933+
warning("UseAVX=%d requires UseSSE=4, setting it to UseAVX=0", UseAVX);
934934
} else {
935-
warning("UseAVX=%d is not supported on this CPU, setting it to UseAVX=%d", (int) UseAVX, use_avx_limit);
935+
warning("UseAVX=%d is not supported on this CPU, setting it to UseAVX=%d", UseAVX, use_avx_limit);
936936
}
937937
FLAG_SET_DEFAULT(UseAVX, use_avx_limit);
938938
}
@@ -1860,9 +1860,9 @@ void VM_Version::get_processor_features() {
18601860
log->print_cr("Logical CPUs per core: %u",
18611861
logical_processors_per_package());
18621862
log->print_cr("L1 data cache line size: %u", L1_data_cache_line_size());
1863-
log->print("UseSSE=%d", (int) UseSSE);
1863+
log->print("UseSSE=%d", UseSSE);
18641864
if (UseAVX > 0) {
1865-
log->print(" UseAVX=%d", (int) UseAVX);
1865+
log->print(" UseAVX=%d", UseAVX);
18661866
}
18671867
if (UseAES) {
18681868
log->print(" UseAES=1");

src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
232232
do_uintx_flag(TLABWasteIncrement) \
233233
do_intx_flag(TypeProfileWidth) \
234234
do_bool_flag(UseAESIntrinsics) \
235-
X86_ONLY(do_intx_flag(UseAVX)) \
235+
X86_ONLY(do_int_flag(UseAVX)) \
236236
do_bool_flag(UseCRC32Intrinsics) \
237237
do_bool_flag(UseAdler32Intrinsics) \
238238
do_bool_flag(UseCompressedClassPointers) \
@@ -252,7 +252,7 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) {
252252
do_bool_flag(UseSHA1Intrinsics) \
253253
do_bool_flag(UseSHA256Intrinsics) \
254254
do_bool_flag(UseSHA512Intrinsics) \
255-
X86_ONLY(do_intx_flag(UseSSE)) \
255+
X86_ONLY(do_int_flag(UseSSE)) \
256256
COMPILER2_PRESENT(do_bool_flag(UseSquareToLenIntrinsic)) \
257257
do_bool_flag(UseTLAB) \
258258
do_bool_flag(VerifyOops) \

test/hotspot/jtreg/compiler/floatingpoint/NaNTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static void main(String args[]) {
8282
// native methods that use FPU instructions, and those strip the
8383
// signaling NaNs.
8484
if (Platform.isX86()) {
85-
int sse = WHITE_BOX.getIntxVMFlag("UseSSE").intValue();
85+
int sse = WHITE_BOX.getIntVMFlag("UseSSE").intValue();
8686
expectStableFloats = (sse >= 1);
8787
expectStableDoubles = (sse >= 2);
8888
}

0 commit comments

Comments
 (0)