[pypy-commit] pypy arm-backend-2: (arigo, bivab) refactor a bit and fix decode_inputargs when checking spilled floating point values

bivab noreply at buildbot.pypy.org
Tue Oct 25 11:07:44 CEST 2011


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r48411:744854db4b1c
Date: 2011-10-19 10:51 +0200
http://bitbucket.org/pypy/pypy/changeset/744854db4b1c/

Log:	(arigo, bivab) refactor a bit and fix decode_inputargs when checking
	spilled floating point values

diff --git a/pypy/jit/backend/arm/assembler.py b/pypy/jit/backend/arm/assembler.py
--- a/pypy/jit/backend/arm/assembler.py
+++ b/pypy/jit/backend/arm/assembler.py
@@ -36,6 +36,7 @@
     """
     Encoding for locations in memory
     types:
+    \xED = FLOAT
     \xEE = REF
     \xEF = INT
     location:
@@ -98,6 +99,7 @@
         self._regalloc = None
         self.mc = None
         self.pending_guards = None
+        assert self.datablockwrapper is None
 
     def setup_once(self):
         # Addresses of functions called by new_xxx operations
@@ -267,16 +269,14 @@
         self.fail_force_index = frame_loc
         return descr
 
-    def decode_inputargs(self, enc, inputargs, regalloc):
+    def decode_inputargs(self, enc, regalloc):
         locs = []
         j = 0
-        for i in range(len(inputargs)):
+        while enc[j] != self.END_OF_LOCS:
             res = enc[j]
-            if res == self.END_OF_LOCS:
-                assert 0, 'reached end of encoded area'
-            while res == self.EMPTY_LOC:
+            if res == self.EMPTY_LOC:
                 j += 1
-                res = enc[j]
+                continue
 
             assert res in [self.FLOAT_TYPE, self.INT_TYPE, self.REF_TYPE], 'location type is not supported'
             res_type = res
@@ -286,10 +286,14 @@
                 # XXX decode imm if necessary
                 assert 0, 'Imm Locations are not supported'
             elif res == self.STACK_LOC:
-                if res_type == FLOAT:
-                    assert 0, 'float on stack'
+                if res_type == self.FLOAT_TYPE:
+                    t = FLOAT
+                elif res_type == self.INT_TYPE:
+                    t = INT
+                else:
+                    t = REF
                 stack_loc = decode32(enc, j+1)
-                loc = regalloc.frame_manager.frame_pos(stack_loc, INT)
+                loc = regalloc.frame_manager.frame_pos(stack_loc, t)
                 j += 4
             else: # REG_LOC
                 if res_type == self.FLOAT_TYPE:
@@ -665,7 +669,8 @@
 
         sp_patch_location = self._prepare_sp_patch_position()
         frame_depth = faildescr._arm_frame_depth
-        locs = self.decode_inputargs(enc, inputargs, regalloc)
+        locs = self.decode_inputargs(enc, regalloc)
+        assert len(inputargs) == len(locs)
         regalloc.update_bindings(locs, frame_depth, inputargs)
 
         self._walk_operations(operations, regalloc)
@@ -862,7 +867,7 @@
             self.mc.VLDR(loc.value, r.ip.value)
 
     def _mov_imm_to_loc(self, prev_loc, loc, cond=c.AL):
-        if not loc.is_reg() and not (loc.is_stack() and loc.type == INT):
+        if not loc.is_reg() and not (loc.is_stack() and loc.type != FLOAT):
             raise AssertionError("invalid target for move from imm value")
         if loc.is_reg():
             new_loc = loc


More information about the pypy-commit mailing list