[pypy-commit] pypy default: (fijal, remi, arigo)

arigo noreply at buildbot.pypy.org
Sun Feb 22 18:22:57 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r76051:b3a08c810002
Date: 2015-02-22 17:23 +0100
http://bitbucket.org/pypy/pypy/changeset/b3a08c810002/

Log:	(fijal, remi, arigo)

	Meh, sometimes we get an extra "mov" and sometimes we don't,
	depending on whether some pointers fit into 2GB.

diff --git a/rpython/jit/backend/test/runner_test.py b/rpython/jit/backend/test/runner_test.py
--- a/rpython/jit/backend/test/runner_test.py
+++ b/rpython/jit/backend/test/runner_test.py
@@ -47,6 +47,7 @@
 
     add_loop_instructions = ['overload for a specific cpu']
     bridge_loop_instructions = ['overload for a specific cpu']
+    bridge_loop_instructions_alternative = None   # or another possible answer
 
     def execute_operation(self, opname, valueboxes, result_type, descr=None):
         inputargs, operations = self._get_single_operation_list(opname,
@@ -4284,7 +4285,9 @@
         # XXX we have to check the precise assembler, otherwise
         # we don't quite know if borders are correct
 
-        def checkops(mc, ops):
+        def checkops(mc, ops, alt_ops=None):
+            if len(mc) != len(ops) and alt_ops is not None:
+                ops = alt_ops
             assert len(mc) == len(ops)
             for i in range(len(mc)):
                 if ops[i] == '*':
@@ -4299,7 +4302,8 @@
             data = ctypes.string_at(bridge_info.asmaddr, bridge_info.asmlen)
             mc = list(machine_code_dump(data, bridge_info.asmaddr, cpuname))
             lines = [line for line in mc if line.count('\t') >= 2]
-            checkops(lines, self.bridge_loop_instructions)
+            checkops(lines, self.bridge_loop_instructions,
+                            self.bridge_loop_instructions_alternative)
         except ObjdumpNotFound:
             py.test.skip("requires (g)objdump")
 
diff --git a/rpython/jit/backend/x86/test/test_runner.py b/rpython/jit/backend/x86/test/test_runner.py
--- a/rpython/jit/backend/x86/test/test_runner.py
+++ b/rpython/jit/backend/x86/test/test_runner.py
@@ -34,8 +34,10 @@
     if WORD == 4:
         bridge_loop_instructions = ['cmp', 'jge', 'mov', 'mov', 'call', 'jmp']
     else:
-        bridge_loop_instructions = ['cmp', 'jge', 'mov', 'mov', 'mov', 'mov',
-                                    'call', 'mov', 'jmp']
+        bridge_loop_instructions = [
+            'cmp', 'jge', 'mov', 'mov', 'mov', 'mov', 'call', 'mov', 'jmp']
+        bridge_loop_instructions_alternative = [
+            'cmp', 'jge', 'mov', 'mov', 'mov', 'call', 'mov', 'jmp']
 
     def get_cpu(self):
         cpu = CPU(rtyper=None, stats=FakeStats())


More information about the pypy-commit mailing list