Author: edelsohn
Branch: ppc-jit-backend
Changeset: r56845:21bb7d2dea71
Date: 2012-08-24 20:57 -0400
http://bitbucket.org/pypy/pypy/changeset/21bb7d2dea71/

Log:    Support immediate value second argument in
        prepare_binary_int_op_with_imm.

diff --git a/pypy/jit/backend/ppc/helper/regalloc.py 
b/pypy/jit/backend/ppc/helper/regalloc.py
--- a/pypy/jit/backend/ppc/helper/regalloc.py
+++ b/pypy/jit/backend/ppc/helper/regalloc.py
@@ -59,10 +59,14 @@
 
 def prepare_binary_int_op_with_imm():
     def f(self, op):
+        a0 = op.getarg(0)
+        a1 = op.getarg(1)
         boxes = op.getarglist()
-        b0, b1 = boxes
-        l0 = self._ensure_value_is_boxed(b0, boxes)
-        l1 = self._ensure_value_is_boxed(b1, boxes)
+        l0 = self._ensure_value_is_boxed(a0, boxes)
+        if isinstance(a1, ConstInt) and _check_imm_arg(a1.getint()):
+            l1 = self.convert_to_imm(a1)
+        else:
+            l1 = self._ensure_value_is_boxed(a1, boxes)
         locs = [l0, l1]
         self.possibly_free_vars_for_op(op)
         self.free_temp_vars()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to