[pypy-commit] pypy faster-rstruct-2: this this test_pypy_c test: now struct.unpack generates a fast raw_load_i; use 'i' instead of '<i' to make sure that we get the same code even on big endian machines

antocuni pypy.commits at gmail.com
Tue May 23 04:50:15 EDT 2017


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: faster-rstruct-2
Changeset: r91383:6878ac6c89b8
Date: 2017-05-23 10:49 +0200
http://bitbucket.org/pypy/pypy/changeset/6878ac6c89b8/

Log:	this this test_pypy_c test: now struct.unpack generates a fast
	raw_load_i; use 'i' instead of '<i' to make sure that we get the
	same code even on big endian machines

diff --git a/pypy/module/pypyjit/test_pypy_c/test_buffers.py b/pypy/module/pypyjit/test_pypy_c/test_buffers.py
--- a/pypy/module/pypyjit/test_pypy_c/test_buffers.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_buffers.py
@@ -34,29 +34,13 @@
             i = 0
             while i < n:
                 i += 1
-                struct.unpack('<i', a)  # ID: unpack
+                struct.unpack('i', a)  # ID: unpack
             return i
         log = self.run(main, [1000])
         assert log.result == 1000
         loop, = log.loops_by_filename(self.filepath)
         assert loop.match_by_id('unpack', """
             guard_not_invalidated(descr=...)
-            p90 = newstr(4)
-            call_n(ConstClass(copy_raw_to_string), i55, p90, 0, 4, descr=<Callv 0 irii EF=5>)
-            guard_no_exception(descr=...)
-            i91 = strgetitem(p90, 0)
-            i92 = strgetitem(p90, 1)
-            i93 = int_lshift(i92, 8)
-            i94 = int_or(i91, i93)
-            i95 = strgetitem(p90, 2)
-            i96 = int_lshift(i95, 16)
-            i97 = int_or(i94, i96)
-            i98 = strgetitem(p90, 3)
-            i99 = int_ge(i98, 128)
-            guard_false(i99, descr=...)
-            i100 = int_lshift(i98, 24)
-            i101 = int_or(i97, i100)
-            i102 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct.c_value 0>)
-            i103 = int_lt(i102, 0)
-            guard_false(i103, descr=...)
+            i66 = raw_load_i(i53, 0, descr=<ArrayS 4>)
+            --TICK--
         """)


More information about the pypy-commit mailing list