[pypy-svn] r31925 - pypy/dist/pypy/jit/codegen/i386

arigo at codespeak.net arigo at codespeak.net
Fri Sep 1 15:18:48 CEST 2006


Author: arigo
Date: Fri Sep  1 15:18:46 2006
New Revision: 31925

Modified:
   pypy/dist/pypy/jit/codegen/i386/ri386genop.py
Log:
(pedronis, arigo)

Implemented same_as.


Modified: pypy/dist/pypy/jit/codegen/i386/ri386genop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/ri386genop.py	(original)
+++ pypy/dist/pypy/jit/codegen/i386/ri386genop.py	Fri Sep  1 15:18:46 2006
@@ -286,6 +286,12 @@
     def op_cast_pointer(self, (gv_x,), gv_RESTYPE):
         return gv_x
 
+    def op_same_as(self, (gv_x,), gv_RESTYPE):
+        if gv_x.is_const:    # must always return a var
+            return self.returnvar(gv_x.operand(self))
+        else:
+            return gv_x
+
     def emit_malloc_fixedsize(self, size):
         # XXX boehm only, no atomic/non atomic distinction for now
         self.push(imm(size))



More information about the Pypy-commit mailing list