[pypy-commit] pypy arm64: cond_call_value_i

fijal pypy.commits at gmail.com
Sat Jun 22 08:16:37 EDT 2019


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: arm64
Changeset: r96839:ebaaa5860fff
Date: 2019-06-22 11:39 +0000
http://bitbucket.org/pypy/pypy/changeset/ebaaa5860fff/

Log:	cond_call_value_i

diff --git a/rpython/jit/backend/aarch64/opassembler.py b/rpython/jit/backend/aarch64/opassembler.py
--- a/rpython/jit/backend/aarch64/opassembler.py
+++ b/rpython/jit/backend/aarch64/opassembler.py
@@ -597,12 +597,11 @@
                                      array=True)
 
     def _emit_op_cond_call(self, op, arglocs, fcond):
-        #if len(arglocs) == 2:
-        #    res_loc = arglocs[1]     # cond_call_value
-        #else:
-        #    res_loc = None           # cond_call
+        if len(arglocs) == 2:
+            res_loc = arglocs[1]     # cond_call_value
+        else:
+            res_loc = None           # cond_call
         # see x86.regalloc for why we skip res_loc in the gcmap
-        res_loc = None
 
         if arglocs[0] is not None: # otherwise result already in CC
             self.mc.CMP_ri(arglocs[0].value, 0)
@@ -631,8 +630,7 @@
 
         self.mc.BL(cond_call_adr)
         # if this is a COND_CALL_VALUE, we need to move the result in place
-        # from its current location (which is, unusually, in r4: see
-        # cond_call_slowpath)
+        # from its current location
         if res_loc is not None:
             self.mc.MOV_rr(res_loc.value, r.ip1.value)
         #
@@ -646,6 +644,9 @@
     def emit_op_cond_call(self, op, arglocs):
         self._emit_op_cond_call(op, arglocs, c.EQ)
 
+    def emit_op_cond_call_value_i(self, op, arglocs):
+        self._emit_op_cond_call(op, arglocs, c.NE)
+
     def emit_guard_op_cond_call(self, op, fcond, arglocs):
         self._emit_op_cond_call(op, arglocs, c.get_opposite_of(fcond))
 
diff --git a/rpython/jit/backend/aarch64/regalloc.py b/rpython/jit/backend/aarch64/regalloc.py
--- a/rpython/jit/backend/aarch64/regalloc.py
+++ b/rpython/jit/backend/aarch64/regalloc.py
@@ -694,7 +694,6 @@
             # true.  Often used just after a comparison operation.
             return [argloc]
         else:
-            XXX
             # COND_CALL_VALUE_I/R.  Calls the function when args[0]
             # is equal to 0 or NULL.  Returns the result from the
             # function call if done, or args[0] if it was not 0/NULL.
@@ -708,14 +707,14 @@
             args = op.getarglist()
             resloc = self.rm.force_result_in_reg(op, args[0],
                                                  forbidden_vars=args[2:])
-            # Test the register for the result.
-            self.assembler.mc.CMP_ri(resloc.value, 0)
-            self.assembler.guard_success_cc = c.EQ
-            return [tmpreg, resloc]
+            return [argloc, resloc]
 
     def prepare_op_cond_call(self, op):
         return self._prepare_op_cond_call(op, False)
 
+    def prepare_op_cond_call_value_i(self, op):
+        return self._prepare_op_cond_call(op, False)        
+
     def prepare_guard_op_cond_call(self, op, prevop):
         fcond = self.assembler.dispatch_comparison(prevop)
         locs = self._prepare_op_cond_call(op, True)


More information about the pypy-commit mailing list