Author: Richard Plangger <r...@pasra.at>
Branch: vecopt
Changeset: r78398:8022a49a8008
Date: 2015-07-02 09:07 +0200
http://bitbucket.org/pypy/pypy/changeset/8022a49a8008/

Log:    preventing signext from int16,int8 to greater or vice versa, the
        first direction was ignored up to now

diff --git a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py 
b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
--- a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
@@ -7,7 +7,7 @@
 class TestMicroNumPy(BaseTestPyPyC):
 
     arith_comb = [('+','float','float', 4*3427,   3427, 1.0,3.0),
-             ('+','float','int',   9*7834,   7843, 4.0,5.0),
+             ('+','float','int',   9*7844,   7843, 4.0,5.0),
              ('+','int','float',   8*2571,   2571, 9.0,-1.0),
              ('+','float','int',   -18*2653,   2653, 4.0,-22.0),
              ('+','int','int',     -1*1499,   1499, 24.0,-25.0),
@@ -21,7 +21,7 @@
              ('|','int','int',     0,        1500, 0,0),
             ]
     type_permuated = []
-    types = { 'int': ['int32','int64'],
+    types = { 'int': ['int32','int64','int8','int16'],
               'float': ['float32', 'float64']
             }
     for arith in arith_comb:
@@ -63,8 +63,8 @@
         ('all','int', 1, 6757, 1),
     ]
     type_permuated = []
-    types = { 'int': ['int64'],
-              'float': ['float64']
+    types = { 'int': ['int8','int16','int32','int64'],
+              'float': ['float32','float64']
             }
     for arith in arith_comb:
         t1 = arith[1]
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
@@ -804,8 +804,9 @@
         self.costmodel = costmodel
 
     def _prevent_signext(self, outsize, insize):
-        if outsize < 4 and insize != outsize:
-            raise NotAProfitableLoop
+        if insize != outsize:
+            if outsize < 4 or insize < 4:
+                raise NotAProfitableLoop
 
     def as_vector_operation(self, pack, preproc_renamer):
         assert pack.opcount() > 1
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to