[pypy-svn] pypy 32ptr-on-64bit: Implement support for HIDE_INTO_PTR32 and SHOW_FROM_PTR32. Easy.
arigo
commits-noreply at bitbucket.org
Sat Apr 16 23:10:04 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch: 32ptr-on-64bit
Changeset: r43411:c773659e239c
Date: 2011-04-16 22:50 +0200
http://bitbucket.org/pypy/pypy/changeset/c773659e239c/
Log: Implement support for HIDE_INTO_PTR32 and SHOW_FROM_PTR32. Easy.
diff --git a/pypy/jit/backend/x86/assembler.py b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -1258,6 +1258,12 @@
self.mc.SHR_ri(resloc.value, 7)
self.mc.AND_ri(resloc.value, 1)
+ def genop_hide_into_ptr32(self, op, arglocs, resloc):
+ self.mc.SHR(resloc, imm(3))
+
+ def genop_show_from_ptr32(self, op, arglocs, resloc):
+ self.mc.SHL(resloc, imm(3))
+
def genop_new_with_vtable(self, op, arglocs, result_loc):
assert result_loc is eax
loc_vtable = arglocs[-1]
diff --git a/pypy/jit/backend/x86/regalloc.py b/pypy/jit/backend/x86/regalloc.py
--- a/pypy/jit/backend/x86/regalloc.py
+++ b/pypy/jit/backend/x86/regalloc.py
@@ -556,6 +556,8 @@
self.Perform(op, [res], res)
consider_int_invert = consider_int_neg
+ consider_hide_into_ptr32 = consider_int_neg # SHR reg, 3
+ consider_show_from_ptr32 = consider_int_neg # SHL reg, 3
def consider_int_lshift(self, op):
if isinstance(op.getarg(1), Const):
More information about the Pypy-commit
mailing list