[pypy-commit] pypy release-pypy3.6-v7.x: merge py3.6 into release

mattip pypy.commits at gmail.com
Thu Mar 21 08:14:32 EDT 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: release-pypy3.6-v7.x
Changeset: r96339:7a2e437acfce
Date: 2019-03-21 14:13 +0200
http://bitbucket.org/pypy/pypy/changeset/7a2e437acfce/

Log:	merge py3.6 into release

diff --git a/lib_pypy/_blake2/_blake2_build.py b/lib_pypy/_blake2/_blake2_build.py
--- a/lib_pypy/_blake2/_blake2_build.py
+++ b/lib_pypy/_blake2/_blake2_build.py
@@ -4,17 +4,18 @@
 
 from cffi import FFI
 
-IS_ARM = platform.machine().startswith('arm')
 IS_WIN = sys.platform == 'win32'
-if IS_ARM:
-    # XXX Choose neon accelaration
-    define_macros = []
-    extra_compile_args = []
-elif IS_WIN:
+if IS_WIN:
+    BLAKE2_USE_SSE = True
     extra_compile_args = []
     define_macros = [('__SSE2__', '1')]
+elif platform.machine().startswith('x86'):
+    BLAKE2_USE_SSE = True
+    extra_compile_args = ['-msse2']
+    define_macros = []
 else:
-    extra_compile_args = ['-msse2']
+    BLAKE2_USE_SSE = False
+    extra_compile_args = []
     define_macros = []
     
     
@@ -80,13 +81,18 @@
 
 
 _libdir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'impl'))
+if BLAKE2_USE_SSE:
+    sourcesB=[os.path.join(_libdir, 'blake2b.c'), ]
+    sourcesS=[os.path.join(_libdir, 'blake2s.c'), ]
+else:    
+    sourcesB=[os.path.join(_libdir, 'blake2b-ref.c'), ]
+    sourcesS=[os.path.join(_libdir, 'blake2s-ref.c'), ]
 
 blake2b_ffi = FFI()
 blake2b_ffi.cdef(blake_cdef)
 blake2b_ffi.set_source(
     '_blake2b_cffi', blake2b_source,
-    sources=[os.path.join(_libdir, 'blake2b.c'),
-            ],
+    sources=sourcesB,
     include_dirs=[_libdir],
     extra_compile_args=extra_compile_args,
     define_macros=define_macros,
@@ -102,8 +108,7 @@
 blake2s_ffi.cdef(blake_cdef)
 blake2s_ffi.set_source(
     '_blake2s_cffi', _replace_b2s(blake2b_source),
-    sources=[os.path.join(_libdir, 'blake2s.c'),
-            ],
+    sources=sourcesS,
     include_dirs=[_libdir],
     extra_compile_args=extra_compile_args,
     define_macros=define_macros,
diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py
--- a/pypy/tool/build_cffi_imports.py
+++ b/pypy/tool/build_cffi_imports.py
@@ -224,7 +224,7 @@
                 print("stdout:")
                 print(stdout.decode('utf-8'))
                 print("stderr:")
-                print(stderr.decode('utf-8'))
+                print(stderr)
         except:
             import traceback;traceback.print_exc()
             failures.append((key, module))


More information about the pypy-commit mailing list