[pypy-svn] pypy arm-backend-2: Improve INT_NEG using reverse substract and remove another XXX

bivab commits-noreply at bitbucket.org
Fri Jan 14 10:24:59 CET 2011


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r40660:cb9f19eeaefc
Date: 2011-01-12 10:49 +0100
http://bitbucket.org/pypy/pypy/changeset/cb9f19eeaefc/

Log:	Improve INT_NEG using reverse substract and remove another XXX

diff --git a/pypy/jit/backend/arm/opassembler.py b/pypy/jit/backend/arm/opassembler.py
--- a/pypy/jit/backend/arm/opassembler.py
+++ b/pypy/jit/backend/arm/opassembler.py
@@ -120,12 +120,9 @@
         self.mc.MVN_rr(res.value, reg.value)
         return fcond
 
-    #XXX check for a better way of doing this
     def emit_op_int_neg(self, op, arglocs, regalloc, fcond):
         l0, resloc = arglocs
-
-        self.mc.MVN_ri(r.ip.value, imm=~-1)
-        self.mc.MUL(resloc.value, l0.value, r.ip.value)
+        self.mc.RSB_ri(resloc.value, l0.value, imm=0)
         return fcond
 
 class GuardOpAssembler(object):


More information about the Pypy-commit mailing list