[pypy-commit] pypy optresult-unroll: fix result type

fijal noreply at buildbot.pypy.org
Tue Sep 8 10:26:42 CEST 2015


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: optresult-unroll
Changeset: r79518:628acab79c47
Date: 2015-09-08 10:26 +0200
http://bitbucket.org/pypy/pypy/changeset/628acab79c47/

Log:	fix result type

diff --git a/rpython/jit/backend/llsupport/descr.py b/rpython/jit/backend/llsupport/descr.py
--- a/rpython/jit/backend/llsupport/descr.py
+++ b/rpython/jit/backend/llsupport/descr.py
@@ -474,6 +474,13 @@
     def get_result_type(self):
         return self.result_type
 
+    def get_normalized_result_type(self):
+        if self.result_type == 'S':
+            return 'i'
+        if self.result_type == 'L':
+            return 'f'
+        return self.result_type
+
     def get_result_size(self):
         return self.result_size
 
diff --git a/rpython/jit/metainterp/pyjitpl.py b/rpython/jit/metainterp/pyjitpl.py
--- a/rpython/jit/metainterp/pyjitpl.py
+++ b/rpython/jit/metainterp/pyjitpl.py
@@ -1565,7 +1565,7 @@
                 if resbox is not None:
                     return resbox
             self.metainterp.vable_and_vrefs_before_residual_call()
-            tp = descr.get_result_type()
+            tp = descr.get_normalized_result_type()
             if effectinfo.oopspecindex == effectinfo.OS_LIBFFI_CALL:
                 resbox = self.metainterp.direct_libffi_call(allboxes, descr,
                                                             tp)
@@ -1601,7 +1601,7 @@
             return resbox
         else:
             effect = effectinfo.extraeffect
-            tp = descr.get_result_type()
+            tp = descr.get_normalized_result_type()
             if effect == effectinfo.EF_LOOPINVARIANT:
                 if tp == 'i':
                     return self.execute_varargs(rop.CALL_LOOPINVARIANT_I,
diff --git a/rpython/jit/metainterp/resoperation.py b/rpython/jit/metainterp/resoperation.py
--- a/rpython/jit/metainterp/resoperation.py
+++ b/rpython/jit/metainterp/resoperation.py
@@ -1021,7 +1021,7 @@
 class OpHelpers(object):
     @staticmethod
     def call_for_descr(descr):
-        tp = descr.get_result_type()
+        tp = descr.get_normalized_result_type()
         if tp == 'i':
             return rop.CALL_I
         elif tp == 'r':
@@ -1033,7 +1033,7 @@
 
     @staticmethod
     def call_pure_for_descr(descr):
-        tp = descr.get_result_type()
+        tp = descr.get_normalized_result_type()
         if tp == 'i':
             return rop.CALL_PURE_I
         elif tp == 'r':
@@ -1045,7 +1045,7 @@
 
     @staticmethod
     def call_may_force_for_descr(descr):
-        tp = descr.get_result_type()
+        tp = descr.get_normalized_result_type()
         if tp == 'i':
             return rop.CALL_MAY_FORCE_I
         elif tp == 'r':
@@ -1057,7 +1057,7 @@
 
     @staticmethod
     def call_assembler_for_descr(descr):
-        tp = descr.get_result_type()
+        tp = descr.get_normalized_result_type()
         if tp == 'i':
             return rop.CALL_ASSEMBLER_I
         elif tp == 'r':
@@ -1069,7 +1069,7 @@
 
     @staticmethod
     def call_loopinvariant_for_descr(descr):
-        tp = descr.get_result_type()
+        tp = descr.get_normalized_result_type()
         if tp == 'i':
             return rop.CALL_LOOPINVARIANT_I
         elif tp == 'r':


More information about the pypy-commit mailing list