From: Bruce Forstall Date: Sat, 27 Aug 2016 01:25:42 +0000 (-0700) Subject: RyuJIT x86: Fix initblk with unrolled loop and constant fill X-Git-Tag: submit/tizen/20210909.063632~11030^2~9553^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d67a4751f3bfe7b2874abef3db2ce0975707f14f;p=platform%2Fupstream%2Fdotnet%2Fruntime.git 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 dotnet/coreclr#6940 Commit migrated from https://github.com/dotnet/coreclr/commit/5127eef602e0c0ed5ab7f63a9bc28b81558b2084 --- diff --git a/src/coreclr/src/jit/codegenxarch.cpp b/src/coreclr/src/jit/codegenxarch.cpp index 5e35067..e616305 100755 --- a/src/coreclr/src/jit/codegenxarch.cpp +++ b/src/coreclr/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 {