Use xorps instead of xorpd
authorMike Danes <onemihaid@hotmail.com>
Tue, 30 Jan 2018 19:45:58 +0000 (21:45 +0200)
committerMike Danes <onemihaid@hotmail.com>
Tue, 30 Jan 2018 20:29:49 +0000 (22:29 +0200)
src/jit/codegencommon.cpp
src/jit/codegenxarch.cpp

index e0046d2..0ae3582 100644 (file)
@@ -6722,11 +6722,8 @@ void CodeGen::genZeroInitFltRegs(const regMaskTP& initFltRegs, const regMaskTP&
                     inst_RV_RV(INS_vmov_i2f, reg, initReg, TYP_FLOAT, EA_4BYTE);
                 }
 #elif defined(_TARGET_XARCH_)
-                // Xorpd xmmreg, xmmreg is the fastest way to initialize a float register to
-                // zero instead of moving constant 0.0f.  Though we just need to initialize just the 32-bits
-                // we will use xorpd to initialize 64-bits of the xmm register so that it can be
-                // used to zero initialize xmm registers that hold double values.
-                inst_RV_RV(INS_xorpd, reg, reg, TYP_DOUBLE);
+                // XORPS is the fastest and smallest way to initialize a XMM register to zero.
+                inst_RV_RV(INS_xorps, reg, reg, TYP_DOUBLE);
                 dblInitReg = reg;
 #elif defined(_TARGET_ARM64_)
                 NYI("Initialize floating-point register to zero");
@@ -6759,10 +6756,8 @@ void CodeGen::genZeroInitFltRegs(const regMaskTP& initFltRegs, const regMaskTP&
                     inst_RV_RV_RV(INS_vmov_i2d, reg, initReg, initReg, EA_8BYTE);
                 }
 #elif defined(_TARGET_XARCH_)
-                // Xorpd xmmreg, xmmreg is the fastest way to initialize a double register to
-                // zero than moving constant 0.0d.  We can also use lower 32-bits of 'reg'
-                // for zero initializing xmm registers subsequently that contain float values.
-                inst_RV_RV(INS_xorpd, reg, reg, TYP_DOUBLE);
+                // XORPS is the fastest and smallest way to initialize a XMM register to zero.
+                inst_RV_RV(INS_xorps, reg, reg, TYP_DOUBLE);
                 fltInitReg = reg;
 #elif defined(_TARGET_ARM64_)
                 // We will just zero out the entire vector register. This sets it to a double zero value
index 32eb482..b1290ea 100644 (file)
@@ -2787,7 +2787,7 @@ void CodeGen::genCodeForInitBlkUnroll(GenTreeBlk* initBlkNode)
         }
         else
         {
-            emit->emitIns_R_R(INS_xorpd, EA_8BYTE, tmpReg, tmpReg);
+            emit->emitIns_R_R(INS_xorps, EA_8BYTE, tmpReg, tmpReg);
         }
 
         // Determine how many 16 byte slots we're going to fill using SSE movs.