[pypy-commit] pypy stmgc-c4: fix for ptr_eq because a function returning _Bool only sets the lower 8 bits of the return value

Raemi noreply at buildbot.pypy.org
Mon Aug 19 14:50:43 CEST 2013


Author: Remi Meier <remi.meier at gmail.com>
Branch: stmgc-c4
Changeset: r66211:c2953cb28b82
Date: 2013-08-19 14:40 +0200
http://bitbucket.org/pypy/pypy/changeset/c2953cb28b82/

Log:	fix for ptr_eq because a function returning _Bool only sets the
	lower 8 bits of the return value

diff --git a/rpython/jit/backend/x86/assembler.py b/rpython/jit/backend/x86/assembler.py
--- a/rpython/jit/backend/x86/assembler.py
+++ b/rpython/jit/backend/x86/assembler.py
@@ -2337,8 +2337,9 @@
         mc.CALL(imm(func))
         # result still on stack
         mc.POP_r(X86_64_SCRATCH_REG.value)
-        # set flags:
-        mc.TEST_rr(X86_64_SCRATCH_REG.value, X86_64_SCRATCH_REG.value)
+        # _Bool return type only sets lower 8 bits of return value
+        sl = X86_64_SCRATCH_REG.lowest8bits()
+        mc.CMP8_ri(sl.value, 0)
         #
         # END SLOWPATH
         #


More information about the pypy-commit mailing list