[pypy-commit] pypy ffi-backend: Rename: the test passes on 64-bit with raw_load/raw_store instead of the

arigo noreply at buildbot.pypy.org
Sat Jul 28 16:17:29 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: ffi-backend
Changeset: r56494:3b360d7b6599
Date: 2012-07-28 16:17 +0200
http://bitbucket.org/pypy/pypy/changeset/3b360d7b6599/

Log:	Rename: the test passes on 64-bit with raw_load/raw_store instead of
	the previous {get,set}interiorfield_raw. It still fails on 32-bit
	though.

diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -83,8 +83,8 @@
 
     def test_add(self):
         result = self.run("add")
-        self.check_simple_loop({'getinteriorfield_raw': 2, 'float_add': 1,
-                                'setinteriorfield_raw': 1, 'int_add': 1,
+        self.check_simple_loop({'raw_load': 2, 'float_add': 1,
+                                'raw_store': 1, 'int_add': 1,
                                 'int_ge': 1, 'guard_false': 1, 'jump': 1,
                                 'arraylen_gc': 1})
         assert result == 3 + 3
@@ -98,8 +98,8 @@
     def test_floatadd(self):
         result = self.run("float_add")
         assert result == 3 + 3
-        self.check_simple_loop({"getinteriorfield_raw": 1, "float_add": 1,
-                                "setinteriorfield_raw": 1, "int_add": 1,
+        self.check_simple_loop({"raw_load": 1, "float_add": 1,
+                                "raw_store": 1, "int_add": 1,
                                 "int_ge": 1, "guard_false": 1, "jump": 1,
                                 'arraylen_gc': 1})
 
@@ -113,7 +113,7 @@
     def test_sum(self):
         result = self.run("sum")
         assert result == 2 * sum(range(30))
-        self.check_simple_loop({"getinteriorfield_raw": 2, "float_add": 2,
+        self.check_simple_loop({"raw_load": 2, "float_add": 2,
                                 "int_add": 1, "int_ge": 1, "guard_false": 1,
                                 "jump": 1, 'arraylen_gc': 1})
 
@@ -129,8 +129,8 @@
         assert result == 30
         # XXX note - the bridge here is fairly crucial and yet it's pretty
         #            bogus. We need to improve the situation somehow.
-        self.check_simple_loop({'getinteriorfield_raw': 2,
-                                'setinteriorfield_raw': 1,
+        self.check_simple_loop({'raw_load': 2,
+                                'raw_store': 1,
                                 'arraylen_gc': 2,
                                 'guard_true': 1,
                                 'int_lt': 1,
@@ -152,7 +152,7 @@
         for i in range(30):
             expected *= i * 2
         assert result == expected
-        self.check_simple_loop({"getinteriorfield_raw": 2, "float_add": 1,
+        self.check_simple_loop({"raw_load": 2, "float_add": 1,
                                 "float_mul": 1, "int_add": 1,
                                 "int_ge": 1, "guard_false": 1, "jump": 1,
                                 'arraylen_gc': 1})
@@ -169,7 +169,7 @@
         result = self.run("max")
         assert result == 256
         py.test.skip("not there yet, getting though")
-        self.check_simple_loop({"getinteriorfield_raw": 2, "float_add": 1,
+        self.check_simple_loop({"raw_load": 2, "float_add": 1,
                                 "float_mul": 1, "int_add": 1,
                                 "int_lt": 1, "guard_true": 1, "jump": 1})
 
@@ -182,7 +182,7 @@
         min(b)
         """)
         assert result == -24
-        self.check_simple_loop({"getinteriorfield_raw": 2, "float_add": 1,
+        self.check_simple_loop({"raw_load": 2, "float_add": 1,
                                 "float_mul": 1, "int_add": 1,
                                 "int_lt": 1, "guard_true": 1, "jump": 1})
 
@@ -197,7 +197,7 @@
     def test_any(self):
         result = self.run("any")
         assert result == 1
-        self.check_simple_loop({"getinteriorfield_raw": 2, "float_add": 1,
+        self.check_simple_loop({"raw_load": 2, "float_add": 1,
                                 "int_and": 1, "int_add": 1,
                                 'cast_float_to_int': 1,
                                 "int_ge": 1, "jump": 1,
@@ -219,12 +219,12 @@
         # optimization then you end up with 2 float_adds, so we can still be
         # sure it was optimized correctly.
         py.test.skip("too fragile")
-        self.check_resops({'setinteriorfield_raw': 4, 'getfield_gc': 22,
+        self.check_resops({'raw_store': 4, 'getfield_gc': 22,
                            'getarrayitem_gc': 4, 'getarrayitem_gc_pure': 2,
                            'getfield_gc_pure': 8,
                            'guard_class': 8, 'int_add': 8, 'float_mul': 2,
                            'jump': 2, 'int_ge': 4,
-                           'getinteriorfield_raw': 4, 'float_add': 2,
+                           'raw_load': 4, 'float_add': 2,
                            'guard_false': 4, 'arraylen_gc': 2, 'same_as': 2})
 
     def define_ufunc():
@@ -238,9 +238,9 @@
     def test_ufunc(self):
         result = self.run("ufunc")
         assert result == -6
-        self.check_simple_loop({"getinteriorfield_raw": 2, "float_add": 1,
+        self.check_simple_loop({"raw_load": 2, "float_add": 1,
                                 "float_neg": 1,
-                                "setinteriorfield_raw": 1, "int_add": 1,
+                                "raw_store": 1, "int_add": 1,
                                 "int_ge": 1, "guard_false": 1, "jump": 1,
                                 'arraylen_gc': 1})
 
@@ -280,9 +280,9 @@
     def test_slice(self):
         result = self.run("slice")
         assert result == 18
-        self.check_simple_loop({'getinteriorfield_raw': 2,
+        self.check_simple_loop({'raw_load': 2,
                                 'float_add': 1,
-                                'setinteriorfield_raw': 1,
+                                'raw_store': 1,
                                 'int_add': 3,
                                 'int_ge': 1, 'guard_false': 1,
                                 'jump': 1,
@@ -298,12 +298,12 @@
     def test_take(self):
         result = self.run("take")
         assert result == 3
-        self.check_simple_loop({'getinteriorfield_raw': 2,
+        self.check_simple_loop({'raw_load': 2,
                                 'cast_float_to_int': 1,
                                 'int_lt': 1,
                                 'int_ge': 2,
                                 'guard_false': 3,
-                                'setinteriorfield_raw': 1,
+                                'raw_store': 1,
                                 'int_mul': 1,
                                 'int_add': 3,
                                 'jump': 1,
@@ -321,9 +321,9 @@
         assert result == 8
         # int_add might be 1 here if we try slightly harder with
         # reusing indexes or some optimization
-        self.check_simple_loop({'float_add': 1, 'getinteriorfield_raw': 2,
+        self.check_simple_loop({'float_add': 1, 'raw_load': 2,
                                 'guard_false': 1, 'int_add': 1, 'int_ge': 1,
-                                'jump': 1, 'setinteriorfield_raw': 1,
+                                'jump': 1, 'raw_store': 1,
                                 'arraylen_gc': 1})
 
     def define_multidim_slice():
@@ -370,8 +370,8 @@
         result = self.run("setslice")
         assert result == 11.0
         self.check_trace_count(1)
-        self.check_simple_loop({'getinteriorfield_raw': 2, 'float_add': 1,
-                                'setinteriorfield_raw': 1, 'int_add': 2,
+        self.check_simple_loop({'raw_load': 2, 'float_add': 1,
+                                'raw_store': 1, 'int_add': 2,
                                 'int_eq': 1, 'guard_false': 1, 'jump': 1,
                                 'arraylen_gc': 1})
 
@@ -387,8 +387,8 @@
         result = self.run("virtual_slice")
         assert result == 4
         self.check_trace_count(1)
-        self.check_simple_loop({'getinteriorfield_raw': 2, 'float_add': 1,
-                                'setinteriorfield_raw': 1, 'int_add': 1,
+        self.check_simple_loop({'raw_load': 2, 'float_add': 1,
+                                'raw_store': 1, 'int_add': 1,
                                 'int_ge': 1, 'guard_false': 1, 'jump': 1,
                                 'arraylen_gc': 1})
     def define_flat_iter():
@@ -403,8 +403,8 @@
         result = self.run("flat_iter")
         assert result == 6
         self.check_trace_count(1)
-        self.check_simple_loop({'getinteriorfield_raw': 2, 'float_add': 1,
-                                'setinteriorfield_raw': 1, 'int_add': 2,
+        self.check_simple_loop({'raw_load': 2, 'float_add': 1,
+                                'raw_store': 1, 'int_add': 2,
                                 'int_ge': 1, 'guard_false': 1,
                                 'arraylen_gc': 1, 'jump': 1})
 
@@ -419,8 +419,8 @@
         result = self.run("flat_getitem")
         assert result == 10.0
         self.check_trace_count(1)
-        self.check_simple_loop({'getinteriorfield_raw': 1,
-                                'setinteriorfield_raw': 1,
+        self.check_simple_loop({'raw_load': 1,
+                                'raw_store': 1,
                                 'int_lt': 1,
                                 'int_ge': 1,
                                 'int_add': 3,
@@ -442,8 +442,8 @@
         assert result == 1.0
         self.check_trace_count(1)
         # XXX not ideal, but hey, let's ignore it for now
-        self.check_simple_loop({'getinteriorfield_raw': 1,
-                                'setinteriorfield_raw': 1,
+        self.check_simple_loop({'raw_load': 1,
+                                'raw_store': 1,
                                 'int_lt': 1,
                                 'int_gt': 1,
                                 'int_add': 4,
@@ -471,14 +471,14 @@
         self.check_simple_loop({'arraylen_gc': 9,
                                 'float_add': 1,
                                 'float_mul': 1,
-                                'getinteriorfield_raw': 3,
+                                'raw_load': 3,
                                 'guard_false': 3,
                                 'guard_true': 3,
                                 'int_add': 6,
                                 'int_lt': 6,
                                 'int_sub': 3,
                                 'jump': 1,
-                                'setinteriorfield_raw': 1})
+                                'raw_store': 1})
     
     def define_count_nonzero():
         return """
@@ -490,7 +490,7 @@
         result = self.run("count_nonzero")
         assert result == 9
         self.check_simple_loop({'setfield_gc': 3, 
-                                'getinteriorfield_raw': 1, 
+                                'raw_load': 1, 
                                 'guard_false': 1, 
                                 'jump': 1, 
                                 'int_ge': 1, 


More information about the pypy-commit mailing list