Author: Richard Plangger <[email protected]>
Branch: ppc-vsx-support
Changeset: r88095:dbe73c37fc59
Date: 2016-11-03 09:29 +0100
http://bitbucket.org/pypy/pypy/changeset/dbe73c37fc59/

Log:    prevent overflow during test which would make the result not equal
        (python does not wrap around)

diff --git a/rpython/jit/metainterp/test/test_vector.py 
b/rpython/jit/metainterp/test/test_vector.py
--- a/rpython/jit/metainterp/test/test_vector.py
+++ b/rpython/jit/metainterp/test/test_vector.py
@@ -236,14 +236,14 @@
     vec_int_arith = functools.partial(vec_int_arith, _vector_simple_int)
 
     test_vec_signed_add = \
-        vec_int_arith(lambda a,b: intmask(a+b), rffi.SIGNED)
+        vec_int_arith(lambda a,b: intmask(intmask(a)+intmask(b)), rffi.SIGNED)
     test_vec_int_add = \
         vec_int_arith(lambda a,b: r_int(a)+r_int(b), rffi.INT)
     test_vec_short_add = \
         vec_int_arith(lambda a,b: r_int(a)+r_int(b), rffi.SHORT)
 
-    test_vec_sub_signed = \
-        vec_int_arith(lambda a,b: intmask(a-b), rffi.SIGNED)
+    test_vec_signed_sub = \
+        vec_int_arith(lambda a,b: intmask(intmask(a)-intmask(b)), rffi.SIGNED)
     test_vec_sub_int = \
         vec_int_arith(lambda a,b: r_int(a)-r_int(b), rffi.INT)
     test_vec_sub_short = \
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to