[pypy-commit] pypy vecopt: updated tests to provide arguments for some changed methods. float vector box signed is always false

plan_rich noreply at buildbot.pypy.org
Tue Jun 9 10:54:21 CEST 2015


Author: Richard Plangger <rich at pasra.at>
Branch: vecopt
Changeset: r77980:716facf22bdc
Date: 2015-06-09 10:54 +0200
http://bitbucket.org/pypy/pypy/changeset/716facf22bdc/

Log:	updated tests to provide arguments for some changed methods. float
	vector box signed is always false

diff --git a/rpython/jit/metainterp/optimizeopt/schedule.py b/rpython/jit/metainterp/optimizeopt/schedule.py
--- a/rpython/jit/metainterp/optimizeopt/schedule.py
+++ b/rpython/jit/metainterp/optimizeopt/schedule.py
@@ -91,7 +91,7 @@
         node.clear_dependencies()
         node.emitted = True
 
-def vectorbox_outof_box(box, count=-1, size=-1, type='-', clone_signed=True, signed=False):
+def vectorbox_outof_box(box, count=-1, size=-1, type='-'):
     if box.type not in (FLOAT, INT):
         raise AssertionError("cannot create vector box of type %s" % (box.type))
     signed = True
@@ -103,10 +103,10 @@
     if box.type == VECTOR:
         return PackType.of(box)
     else:
-        if arg.type == INT:
+        if box.type == INT:
             return PackType(INT, 8, True, 2)
-        elif arg.type == FLOAT:
-            return PackType(FLOAT, 8, True, 2)
+        elif box.type == FLOAT:
+            return PackType(FLOAT, 8, False, 2)
 
     raise AssertionError("box %s not supported" % (box,))
 
@@ -146,6 +146,8 @@
     raise AssertionError("getexpandopnum type %s not supported" % (type,))
 
 class PackType(object):
+    # TODO merge with vector box? the save the same fields
+    # difference: this is more of a type specification
     UNKNOWN_TYPE = '-'
 
     def __init__(self, type, size, signed, count=-1):
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_schedule.py b/rpython/jit/metainterp/optimizeopt/test/test_schedule.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_schedule.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_schedule.py
@@ -1,7 +1,7 @@
 import py
 
 from rpython.jit.metainterp.history import TargetToken, JitCellToken, TreeLoop
-from rpython.jit.metainterp.optimizeopt.util import equaloplists
+from rpython.jit.metainterp.optimizeopt.util import equaloplists, Renamer
 from rpython.jit.metainterp.optimizeopt.vectorize import (VecScheduleData,
         Pack, NotAProfitableLoop, VectorizingOptimizer)
 from rpython.jit.metainterp.optimizeopt.dependency import Node
@@ -48,11 +48,12 @@
         vsd = VecScheduleData(vec_reg_size)
         if getvboxfunc is not None:
             vsd.getvector_of_box = getvboxfunc
+        renamer = Renamer()
         for pack in packs:
             if len(pack) == 1:
                 ops.append(pack[0].getoperation())
             else:
-                for op in vsd.as_vector_operation(Pack(pack)):
+                for op in vsd.as_vector_operation(Pack(pack), renamer):
                     ops.append(op)
         loop.operations = ops
         if prepend_invariant:
diff --git a/rpython/jit/tool/oparser.py b/rpython/jit/tool/oparser.py
--- a/rpython/jit/tool/oparser.py
+++ b/rpython/jit/tool/oparser.py
@@ -130,6 +130,8 @@
                 item_size = int(match.group(3)) // 8
                 item_count = int(match.group(5))
                 item_signed = not (match.group(1) == 'u')
+                if item_type == 'f':
+                    item_signed = False
                 box = self.model.BoxVector(item_type, item_count, item_size, item_signed)
                 lbracket = elem.find('[')
                 number = elem[1:lbracket]


More information about the pypy-commit mailing list