8164989: Inflate and compress intrinsics produce incorrect results with avx512
authormcberg
Tue, 06 Sep 2016 09:59:25 -0700
changeset 41065 d1b98cc38f04
parent 41064 35f3a8f40707
child 41066 e8c366069761
child 41318 af7443b374fb
8164989: Inflate and compress intrinsics produce incorrect results with avx512 Summary: disabled avx512 for compress and reastrict using of inflate. Reviewed-by: kvn
hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Thu Sep 01 20:16:04 2016 +0300
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Tue Sep 06 09:59:25 2016 -0700
@@ -8131,8 +8131,7 @@
     jmp(FALSE_LABEL);
 
     clear_vector_masking();   // closing of the stub context for programming mask registers
-  }
-  else {
+  } else {
     movl(result, len); // copy
 
     if (UseAVX == 2 && UseSSE >= 2) {
@@ -8169,8 +8168,7 @@
       bind(COMPARE_TAIL); // len is zero
       movl(len, result);
       // Fallthru to tail compare
-    }
-    else if (UseSSE42Intrinsics) {
+    } else if (UseSSE42Intrinsics) {
       // With SSE4.2, use double quad vector compare
       Label COMPARE_WIDE_VECTORS, COMPARE_TAIL;
 
@@ -10748,7 +10746,10 @@
   // save length for return
   push(len);
 
+  // 8165287: EVEX version disabled for now, needs to be refactored as
+  // it is returning incorrect results.
   if ((UseAVX > 2) && // AVX512
+    0 &&
     VM_Version::supports_avx512vlbw() &&
     VM_Version::supports_bmi2()) {
 
@@ -11067,10 +11068,11 @@
 
       bind(below_threshold);
       bind(copy_new_tail);
-      if (UseAVX > 2) {
+      if ((UseAVX > 2) &&
+        VM_Version::supports_avx512vlbw() &&
+        VM_Version::supports_bmi2()) {
         movl(tmp2, len);
-      }
-      else {
+      } else {
         movl(len, tmp2);
       }
       andl(tmp2, 0x00000007);