[pypy-commit] pypy arm-backend-2: set the name of generated functions for floatint point operations

bivab noreply at buildbot.pypy.org
Tue Oct 25 11:07:45 CEST 2011


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r48412:411d754b81a2
Date: 2011-10-19 10:53 +0200
http://bitbucket.org/pypy/pypy/changeset/411d754b81a2/

Log:	set the name of generated functions for floatint point operations

diff --git a/pypy/jit/backend/arm/helper/regalloc.py b/pypy/jit/backend/arm/helper/regalloc.py
--- a/pypy/jit/backend/arm/helper/regalloc.py
+++ b/pypy/jit/backend/arm/helper/regalloc.py
@@ -1,7 +1,7 @@
 from pypy.jit.backend.arm import conditions as c
 from pypy.jit.backend.arm import registers as r
 from pypy.jit.backend.arm.codebuilder import AbstractARMv7Builder
-from pypy.jit.metainterp.history import ConstInt, BoxInt, Box
+from pypy.jit.metainterp.history import ConstInt, BoxInt, Box, FLOAT
 from pypy.jit.metainterp.history import ConstInt
 
 # XXX create a version that does not need a ConstInt
@@ -56,7 +56,7 @@
         f.__name__ = name
     return f
 
-def prepare_float_op(base=True, float_result=True):
+def prepare_float_op(name=None, base=True, float_result=True):
     def f(self, op, fcond):
         locs = []
         loc1, box1 = self._ensure_value_is_boxed(op.getarg(0))
@@ -66,13 +66,13 @@
             locs.append(loc2)
             self.possibly_free_var(box2)
         self.possibly_free_var(box1)
-        if float_result:
-            res  = self.vfprm.force_allocate_reg(op.result)
-        else:
-            res  = self.rm.force_allocate_reg(op.result)
+        res = self.force_allocate_reg(op.result)
+        assert float_result == (op.result.type == FLOAT)
         self.possibly_free_var(op.result)
         locs.append(res)
         return locs
+    if name:
+        f.__name__ = name
     return f
 
 def prepare_op_by_helper_call(name):
diff --git a/pypy/jit/backend/arm/regalloc.py b/pypy/jit/backend/arm/regalloc.py
--- a/pypy/jit/backend/arm/regalloc.py
+++ b/pypy/jit/backend/arm/regalloc.py
@@ -1072,18 +1072,18 @@
         return size, scale, ofs, ofs_length, ptr
 
 
-    prepare_op_float_add = prepare_float_op()
-    prepare_op_float_sub = prepare_float_op()
-    prepare_op_float_mul = prepare_float_op()
-    prepare_op_float_truediv = prepare_float_op()
-    prepare_op_float_lt = prepare_float_op(float_result=False)
-    prepare_op_float_le = prepare_float_op(float_result=False)
-    prepare_op_float_eq = prepare_float_op(float_result=False)
-    prepare_op_float_ne = prepare_float_op(float_result=False)
-    prepare_op_float_gt = prepare_float_op(float_result=False)
-    prepare_op_float_ge = prepare_float_op(float_result=False)
-    prepare_op_float_neg = prepare_float_op(base=False)
-    prepare_op_float_abs = prepare_float_op(base=False)
+    prepare_op_float_add = prepare_float_op(name='float_add')
+    prepare_op_float_sub = prepare_float_op(name='float_sub')
+    prepare_op_float_mul = prepare_float_op(name='float_mul')
+    prepare_op_float_truediv = prepare_float_op(name='float_truediv')
+    prepare_op_float_lt = prepare_float_op(float_result=False, name='float_lt')
+    prepare_op_float_le = prepare_float_op(float_result=False, name='float_le')
+    prepare_op_float_eq = prepare_float_op(float_result=False, name='float_eq')
+    prepare_op_float_ne = prepare_float_op(float_result=False, name='float_ne')
+    prepare_op_float_gt = prepare_float_op(float_result=False, name='float_gt')
+    prepare_op_float_ge = prepare_float_op(float_result=False, name='float_ge')
+    prepare_op_float_neg = prepare_float_op(base=False, name='float_neg')
+    prepare_op_float_abs = prepare_float_op(base=False, name='float_abs')
 
     def prepare_op_math_sqrt(self, op, fcond):
         loc, box = self._ensure_value_is_boxed(op.getarg(1))


More information about the pypy-commit mailing list