[pypy-svn] r37633 - pypy/dist/pypy/jit/codegen/ppc

arigo at codespeak.net arigo at codespeak.net
Tue Jan 30 19:46:13 CET 2007


Author: arigo
Date: Tue Jan 30 19:46:09 2007
New Revision: 37633

Modified:
   pypy/dist/pypy/jit/codegen/ppc/instruction.py
Log:
Add a __repr__ on CRF2GPR and GPR2CRF.


Modified: pypy/dist/pypy/jit/codegen/ppc/instruction.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/ppc/instruction.py	(original)
+++ pypy/dist/pypy/jit/codegen/ppc/instruction.py	Tue Jan 30 19:46:09 2007
@@ -676,6 +676,11 @@
         self.targetreg = targetreg
         self.bit = bit
         self.negated = negated
+    def __repr__(self):
+        number = self.bit // 4
+        bit = self.bit % 4
+        return '<CRF2GPR-%d r%s, crf%s(%s, %s)>' % (
+            self._magic_index, self.targetreg, number, bit, self.negated)
     def emit(self, asm):
         asm.mfcr(self.targetreg)
         asm.extrwi(self.targetreg, self.targetreg, 1, self.bit)
@@ -687,6 +692,9 @@
         AllocTimeInsn.__init__(self)
         self.targetreg = targetreg
         self.fromreg = fromreg
+    def __repr__(self):
+        return '<GPR2CRF-%d %s, r%s>' % (
+            self._magic_index, self.targetreg, self.fromreg)
     def emit(self, asm):
         asm.cmpwi(self.targetreg.number, self.fromreg, 0)
 



More information about the Pypy-commit mailing list