Commits

Armin Rigo committed 3b360d7

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.

Comments (0)

Files changed (1)

pypy/module/micronumpy/test/test_zjit.py

 
     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
     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})
 
     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})
 
         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,
         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})
         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})
 
         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})
 
     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,
         # 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():
     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})
 
     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,
     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,
         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():
         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})
 
         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():
         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})
 
         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,
         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,
         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 """
         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,