Author: Richard Plangger <planri...@gmail.com>
Branch: zarch-simd-support
Changeset: r87073:c0a1a9742edd
Date: 2016-09-13 16:09 +0200
http://bitbucket.org/pypy/pypy/changeset/c0a1a9742edd/

Log:    add new files to detect features on zarch + basic vector test

diff --git a/rpython/jit/backend/zarch/detect_feature.py 
b/rpython/jit/backend/zarch/detect_feature.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/zarch/detect_feature.py
@@ -0,0 +1,25 @@
+import sys
+import struct
+import platform
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rtyper.tool import rffi_platform
+from rpython.rlib.rmmap import alloc, free
+from rpython.rlib.rstruct.runpack import runpack
+from rpython.translator.platform.arch.s390x import s390x_cpu_revision
+
+SYSTEM = platform.system()
+
+def detect_simd_z_linux():
+    return False
+
+def detect_simd_z():
+    if SYSTEM == 'Linux':
+        machine = s390x_cpu_revision()
+        if machine == "z13":
+            return True
+    return False
+
+if __name__ == '__main__':
+    print 'The following extensions are supported:'
+    if detect_simd_z():
+        print '  - SIMD Z'
diff --git a/rpython/jit/backend/zarch/test/test_zarchvector.py 
b/rpython/jit/backend/zarch/test/test_zarchvector.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/zarch/test/test_zarchvector.py
@@ -0,0 +1,26 @@
+import py
+from rpython.jit.backend.zarch.test import test_basic
+from rpython.jit.metainterp.test import test_vector
+from rpython.jit.backend.zarch.detect_feature import detect_simd_z
+
+
+class TestBasic(test_basic.JitZARCHMixin, test_vector.VectorizeTests):
+    # for the individual tests see
+    # ====> ../../../metainterp/test/test_basic.py
+    def setup_method(self, method):
+        clazz = self.CPUClass
+        def init(*args, **kwargs):
+            cpu = clazz(*args, **kwargs)
+            # > 95% can be executed, thus let's cheat here a little
+            cpu.supports_guard_gc_type = True
+            return cpu
+        self.CPUClass = init
+
+    def supports_vector_ext(self):
+        return detect_simd_z()
+
+    def test_list_vectorize(self):
+        pass # needs support_guard_gc_type, disable for now
+
+    enable_opts = 
'intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll'
+
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to