From 5127eef602e0c0ed5ab7f63a9bc28b81558b2084 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Fri, 26 Aug 2016 18:25:42 -0700 Subject: [PATCH] RyuJIT x86: Fix initblk with unrolled loop and constant fill The computed fill value was only using the low 8 bytes of the xmm register; we need it to fill the entire 16 byte register. Fixes #6940 --- src/jit/codegenxarch.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp index 5e3506790f..e61630541e 100755 --- a/src/jit/codegenxarch.cpp +++ b/src/jit/codegenxarch.cpp @@ -3489,8 +3489,12 @@ void CodeGen::genCodeForInitBlkUnroll(GenTreeInitBlk* initBlkNode) if (initVal->gtIntCon.gtIconVal != 0) { - emit->emitIns_R_R(INS_mov_i2xmm, EA_8BYTE, tmpReg, valReg); + emit->emitIns_R_R(INS_mov_i2xmm, EA_PTRSIZE, tmpReg, valReg); emit->emitIns_R_R(INS_punpckldq, EA_8BYTE, tmpReg, tmpReg); +#ifdef _TARGET_X86_ + // For x86, we need one more to convert it from 8 bytes to 16 bytes. + emit->emitIns_R_R(INS_punpckldq, EA_8BYTE, tmpReg, tmpReg); +#endif // _TARGET_X86_ } else { -- 2.34.1