8041957: -XX:UseAVX=0 cause assert(UseAVX) failed
authorkvn
Tue, 29 Apr 2014 12:20:53 -0700
changeset 24325 7a1b3799b906
parent 24324 e18584aa83e2
child 24326 d3fdd5c16fe0
child 24338 bff6fc677861
child 24340 30d481fc4e30
8041957: -XX:UseAVX=0 cause assert(UseAVX) failed Summary: temporary set UseAVX=1 and UseSSE=2 in generate_get_cpu_info() Reviewed-by: twisti
hotspot/src/cpu/x86/vm/assembler_x86.cpp
hotspot/src/cpu/x86/vm/vm_version_x86.cpp
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp	Tue Apr 29 10:29:56 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp	Tue Apr 29 12:20:53 2014 -0700
@@ -1766,7 +1766,7 @@
 
 // Move Unaligned 256bit Vector
 void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) {
-  assert(UseAVX, "");
+  assert(UseAVX > 0, "");
   bool vector256 = true;
   int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, vector256);
   emit_int8(0x6F);
@@ -1774,7 +1774,7 @@
 }
 
 void Assembler::vmovdqu(XMMRegister dst, Address src) {
-  assert(UseAVX, "");
+  assert(UseAVX > 0, "");
   InstructionMark im(this);
   bool vector256 = true;
   vex_prefix(dst, xnoreg, src, VEX_SIMD_F3, vector256);
@@ -1783,7 +1783,7 @@
 }
 
 void Assembler::vmovdqu(Address dst, XMMRegister src) {
-  assert(UseAVX, "");
+  assert(UseAVX > 0, "");
   InstructionMark im(this);
   bool vector256 = true;
   // swap src<->dst for encoding
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Tue Apr 29 10:29:56 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Tue Apr 29 12:20:53 2014 -0700
@@ -263,6 +263,10 @@
     // and check upper YMM bits after it.
     //
     VM_Version::set_avx_cpuFeatures(); // Enable temporary to pass asserts
+    intx saved_useavx = UseAVX;
+    intx saved_usesse = UseSSE;
+    UseAVX = 1;
+    UseSSE = 2;
 
     // load value into all 32 bytes of ymm7 register
     __ movl(rcx, VM_Version::ymm_test_value());
@@ -292,6 +296,8 @@
 #endif
 
     VM_Version::clean_cpuFeatures();
+    UseAVX = saved_useavx;
+    UseSSE = saved_usesse;
 
     //
     // cpuid(0x7) Structured Extended Features