Explorar o código

x86/x64: Fix fusion of comparisons with u8/u16 XLOAD.

Mike Pall %!s(int64=14) %!d(string=hai) anos
pai
achega
e2246db688
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/lj_asm_x86.h

+ 2 - 0
src/lj_asm_x86.h

@@ -2037,6 +2037,8 @@ static void asm_comp(ASMState *as, IRIns *ir, uint32_t cc)
 	  left = asm_fuseload(as, lref, RSET_GPR);
 	  irl->t = origt;
 	  if (left == RID_MRM) {  /* Fusion succeeded? */
+	    if (irt_isu8(irl->t) || irt_isu16(irl->t))
+	      cc >>= 4;  /* Need unsigned compare. */
 	    asm_guardcc(as, cc);
 	    emit_i8(as, imm);
 	    emit_mrm(as, (irt_isi8(origt) || irt_isu8(origt)) ?