Commits

Remi Meier committed 455bc75

more testing, more fixes

Comments (0)

Files changed (2)

rpython/jit/backend/llsupport/test/zrpy_gc_test.py

             raiseassert(x1 != ptrs[1])
             raiseassert(x1 == ptrs[2])
             raiseassert(x1 != ptrs[3])
+            raiseassert(x2 == ptrs[0])
+            raiseassert(x2 != ptrs[1])
+            raiseassert(x2 != ptrs[2])
+            raiseassert(x2 != ptrs[3])
+            raiseassert(ptrs[0] is None)
+            raiseassert(ptrs[1] is not None)
+            raiseassert(ptrs[2] is not None)
+            raiseassert(ptrs[3] is not None)
+            raiseassert(ptrs[1] is x0)
+            raiseassert(ptrs[2] is x1)
+            raiseassert(x0 is not None)
+            raiseassert(x1 is not None)
+            raiseassert(x3 is None)
             #
             return n - 1, x, x0, x1, x2, x3, x4, x5, x6, x7, ptrs, s
         return before, f, None

rpython/jit/backend/x86/assembler.py

         # a == b -> SET NZ
         if isinstance(a_base, ImmedLoc) and isinstance(b_base, ImmedLoc):
             if a_base.getint() == b_base.getint():
-                mc.XOR(X86_64_SCRATCH_REG, X86_64_SCRATCH_REG)
-                mc.INC(X86_64_SCRATCH_REG) # NZ flag
+                mc.MOV_ri(X86_64_SCRATCH_REG.value, 1)
+                mc.TEST(X86_64_SCRATCH_REG, X86_64_SCRATCH_REG) # NZ flag
                 mc.JMP_l8(0)
                 j_ok1 = mc.get_relative_pos()
+            else:
+                j_ok1 = 0
         else:
             # do the dance, even if a or b is an Immed
             # XXX: figure out if CMP() is able to handle it without
         #
         
         # OK: flags already set
-        offset = mc.get_relative_pos() - j_ok1
-        mc.overwrite(j_ok1 - 1, chr(offset))
+        if j_ok1:
+            offset = mc.get_relative_pos() - j_ok1
+            mc.overwrite(j_ok1 - 1, chr(offset))
         if j_ok2:
             offset = mc.get_relative_pos() - j_ok2
             mc.overwrite(j_ok2 - 1, chr(offset))