[pypy-svn] r74827 - pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86

jcreigh at codespeak.net jcreigh at codespeak.net
Thu May 27 22:57:11 CEST 2010


Author: jcreigh
Date: Thu May 27 22:57:10 2010
New Revision: 74827

Modified:
   pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/assembler.py
   pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/regloc.py
Log:
add CMP16

Modified: pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/assembler.py	Thu May 27 22:57:10 2010
@@ -996,8 +996,6 @@
         if offset is not None:
             mc.CMP(mem(locs[0], offset), locs[1])
         else:
-            # We haven't implemented CMP16 yet...
-            raise AssertionError("FIXME")
             # XXX hard-coded assumption: to go from an object to its class
             # we use the following algorithm:
             #   - read the typeid from mem(locs[0]), i.e. at offset 0
@@ -1014,7 +1012,7 @@
             type_info_group = llop.gc_get_type_info_group(llmemory.Address)
             type_info_group = rffi.cast(lltype.Signed, type_info_group)
             expected_typeid = (classptr - sizeof_ti - type_info_group) >> 2
-            mc.CMP16(mem(locs[0], 0), imm32(expected_typeid))
+            mc.CMP16(mem(locs[0], 0), ImmedLoc(expected_typeid))
 
     def genop_guard_guard_class(self, ign_1, guard_op, addr, locs, ign_2):
         mc = self._start_block()

Modified: pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/regloc.py
==============================================================================
--- pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/regloc.py	(original)
+++ pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/regloc.py	Thu May 27 22:57:10 2010
@@ -224,6 +224,11 @@
         self.writechar('\x66')
         self.MOV(dest_loc, src_loc)
 
+    def CMP16(self, a_loc, b_loc):
+        # Select 16-bit operand mode
+        self.writechar('\x66')
+        self.CMP(a_loc, b_loc)
+
 def imm(x):
     # XXX: ri386 migration shim
     if isinstance(x, ConstInt):



More information about the Pypy-commit mailing list