src/hotspot/cpu/x86/vm_version_x86.cpp
changeset 50534 a6a44177f99c
parent 50261 3fd701692627
child 50699 cc7fc46cc8c1
--- a/src/hotspot/cpu/x86/vm_version_x86.cpp	Mon Jun 11 14:06:50 2018 -0700
+++ b/src/hotspot/cpu/x86/vm_version_x86.cpp	Tue Jun 12 21:29:47 2018 -0700
@@ -1396,6 +1396,16 @@
     FLAG_SET_DEFAULT(UseFastStosb, false);
   }
 
+  // Use XMM/YMM MOVDQU instruction for Object Initialization
+  if (!UseFastStosb && UseSSE >= 2 && UseUnalignedLoadStores) {
+    if (FLAG_IS_DEFAULT(UseXMMForObjInit)) {
+      UseXMMForObjInit = true;
+    }
+  } else if (UseXMMForObjInit) {
+    warning("UseXMMForObjInit requires SSE2 and unaligned load/stores. Feature is switched off.");
+    FLAG_SET_DEFAULT(UseXMMForObjInit, false);
+  }
+
 #ifdef COMPILER2
   if (FLAG_IS_DEFAULT(AlignVector)) {
     // Modern processors allow misaligned memory operations for vectors.