Author: Richard Plangger <planri...@gmail.com> Branch: ppc-vsx-support Changeset: r88003:7a2d9ced6141 Date: 2016-10-31 17:15 +0100 http://bitbucket.org/pypy/pypy/changeset/7a2d9ced6141/
Log: skip the test if the cpu does not support the vector backend 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 @@ -3,6 +3,18 @@ from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC from rpython.rlib.rawstorage import misaligned_is_fine +def no_vector_backend(): + import platform + if platform.machine().startswith('x86'): + from rpython.jit.backend.x86.detect_feature import detect_sse4_2 + return not detect_sse4_2() + if platform.machine().startswith('ppc'): + from rpython.jit.backend.ppc.detect_feature import detect_vsx + return not detect_vsx() + if platform.machine() == "s390x": + from rpython.jit.backend.zarch.detect_feature import detect_simd_z + return not detect_simd_z() + return True class TestMicroNumPy(BaseTestPyPyC): @@ -36,6 +48,7 @@ type_permuated.append(t) @py.test.mark.parametrize("op,adtype,bdtype,result,count,a,b", type_permuated) + @py.test.mark.skipif('no_vector_backend()') def test_vector_call2(self, op, adtype, bdtype, result, count, a, b): source = """ def main(): @@ -83,6 +96,7 @@ type_permuated.append(t) @py.test.mark.parametrize("op,dtype,result,count,a", type_permuated) + @py.test.mark.skipif('no_vector_backend()') def test_reduce_generic(self,op,dtype,result,count,a): source = """ def main(): diff --git a/rpython/jit/metainterp/compile.py b/rpython/jit/metainterp/compile.py --- a/rpython/jit/metainterp/compile.py +++ b/rpython/jit/metainterp/compile.py @@ -302,7 +302,7 @@ history.cut(cut_at) return None - if ((warmstate.vec and jitdriver_sd.vec) or warmstate.vec_all): + if ((warmstate.vec and jitdriver_sd.vec) or warmstate.vec_all) and metainterp.cpu.vector_ext.is_enabled(): from rpython.jit.metainterp.optimizeopt.vector import optimize_vector loop_info, loop_ops = optimize_vector(trace, metainterp_sd, jitdriver_sd, warmstate, _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit