@@ -9250,8 +9250,11 @@ void emitter::emitIns_SIMD_R_R_A_R(instruction ins,
92509250 // SSE4.1 blendv* hardcode the mask vector (op3) in XMM0
92519251 emitIns_Mov(INS_movaps, attr, REG_XMM0, op3Reg, /* canSkip */ true);
92529252
9253- // Ensure we aren't overwriting op3 (which should be REG_XMM0)
9254- assert(targetReg != REG_XMM0);
9253+ // If targetReg == REG_XMM0, it means that op3 was last use and we decided to
9254+ // reuse REG_XMM0 for destination i.e. targetReg. In such case, make sure
9255+ // that XMM0 value after the (op3Reg -> XMM0) move done above is not
9256+ // overwritten by op1Reg.
9257+ assert((targetReg != REG_XMM0) || (op1Reg == op3Reg));
92559258
92569259 emitIns_Mov(INS_movaps, attr, targetReg, op1Reg, /* canSkip */ true);
92579260 emitIns_R_A(ins, attr, targetReg, indir);
@@ -9325,8 +9328,11 @@ void emitter::emitIns_SIMD_R_R_C_R(instruction ins,
93259328 // SSE4.1 blendv* hardcode the mask vector (op3) in XMM0
93269329 emitIns_Mov(INS_movaps, attr, REG_XMM0, op3Reg, /* canSkip */ true);
93279330
9328- // Ensure we aren't overwriting op3 (which should be REG_XMM0)
9329- assert(targetReg != REG_XMM0);
9331+ // If targetReg == REG_XMM0, it means that op3 was last use and we decided to
9332+ // reuse REG_XMM0 for destination i.e. targetReg. In such case, make sure
9333+ // that XMM0 value after the (op3Reg -> XMM0) move done above is not
9334+ // overwritten by op1Reg.
9335+ assert((targetReg != REG_XMM0) || (op1Reg == op3Reg));
93309336
93319337 emitIns_Mov(INS_movaps, attr, targetReg, op1Reg, /* canSkip */ true);
93329338 emitIns_R_C(ins, attr, targetReg, fldHnd, offs);
@@ -9400,8 +9406,11 @@ void emitter::emitIns_SIMD_R_R_S_R(instruction ins,
94009406 // SSE4.1 blendv* hardcode the mask vector (op3) in XMM0
94019407 emitIns_Mov(INS_movaps, attr, REG_XMM0, op3Reg, /* canSkip */ true);
94029408
9403- // Ensure we aren't overwriting op3 (which should be REG_XMM0)
9404- assert(targetReg != REG_XMM0);
9409+ // If targetReg == REG_XMM0, it means that op3 was last use and we decided to
9410+ // reuse REG_XMM0 for destination i.e. targetReg. In such case, make sure
9411+ // that XMM0 value after the (op3Reg -> XMM0) move done above is not
9412+ // overwritten by op1Reg.
9413+ assert((targetReg != REG_XMM0) || (op1Reg == op3Reg));
94059414
94069415 emitIns_Mov(INS_movaps, attr, targetReg, op1Reg, /* canSkip */ true);
94079416 emitIns_R_S(ins, attr, targetReg, varx, offs);
0 commit comments