Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r79551:aa12a967eb15
Date: 2015-09-08 19:14 +0200
http://bitbucket.org/pypy/pypy/changeset/aa12a967eb15/

Log:    merge

diff --git a/rpython/jit/backend/test/calling_convention_test.py 
b/rpython/jit/backend/test/calling_convention_test.py
--- a/rpython/jit/backend/test/calling_convention_test.py
+++ b/rpython/jit/backend/test/calling_convention_test.py
@@ -373,6 +373,7 @@
                                          [funcbox] + argslist,
                                          'float', descr=calldescr)
             expected = func(*argvalues)
+            res = longlong.getrealfloat(res)
             assert abs(res - expected) < 0.0001
 
 
diff --git a/rpython/jit/backend/x86/regalloc.py 
b/rpython/jit/backend/x86/regalloc.py
--- a/rpython/jit/backend/x86/regalloc.py
+++ b/rpython/jit/backend/x86/regalloc.py
@@ -680,7 +680,7 @@
         args = [op.getarg(1), op.getarg(2)]
         loc1 = self.load_xmm_aligned_16_bytes(args[0])
         loc2 = self.load_xmm_aligned_16_bytes(args[1], args)
-        tmpxvar = TempBox()
+        tmpxvar = TempVar()
         loc3 = self.xrm.force_allocate_reg(tmpxvar, args)
         self.xrm.possibly_free_var(tmpxvar)
         loc0 = self.rm.force_allocate_reg(op, need_lower_byte=True)
@@ -691,11 +691,11 @@
         box = op.getarg(2)
         if not isinstance(box, ConstFloat):
             return False
-        if box.getlonglong() != 0:
+        if box.getfloat() != 0.0:    # NaNs are also != 0.0
             return False
-        # "x < 0"
+        # "x < 0.0" or maybe "x < -0.0" which is the same
         box = op.getarg(1)
-        assert isinstance(box, BoxFloat)
+        assert box.type == FLOAT
         loc1 = self.xrm.make_sure_var_in_reg(box)
         loc0 = self.rm.force_allocate_reg(op)
         self.perform_llong(op, [loc1], loc0)
@@ -720,7 +720,7 @@
             loc2 = None    # unused
         else:
             loc1 = self.rm.make_sure_var_in_reg(box)
-            tmpxvar = TempBox()
+            tmpxvar = TempVar()
             loc2 = self.xrm.force_allocate_reg(tmpxvar, [op])
             self.xrm.possibly_free_var(tmpxvar)
         self.perform_llong(op, [loc1, loc2], loc0)
diff --git a/rpython/jit/metainterp/history.py 
b/rpython/jit/metainterp/history.py
--- a/rpython/jit/metainterp/history.py
+++ b/rpython/jit/metainterp/history.py
@@ -83,10 +83,6 @@
     def getfloat(self):
         return longlong.getrealfloat(self.getfloatstorage())
 
-    def getlonglong(self):
-        assert longlong.supports_longlong
-        return self.getfloatstorage()
-
     def getref_base(self):
         raise NotImplementedError
 
@@ -622,12 +618,12 @@
         elif isinstance(value, bool):
             assert op.type == 'i'
             op.setint(int(value))
-        elif isinstance(value, float):
-            assert op.type == 'f'
-            op.setfloatstorage(value)
         elif lltype.typeOf(value) == lltype.Signed:
             assert op.type == 'i'
             op.setint(value)
+        elif lltype.typeOf(value) is longlong.FLOATSTORAGE:
+            assert op.type == 'f'
+            op.setfloatstorage(value)
         else:
             assert lltype.typeOf(value) == llmemory.GCREF
             assert op.type == 'r'
diff --git a/rpython/jit/metainterp/logger.py b/rpython/jit/metainterp/logger.py
--- a/rpython/jit/metainterp/logger.py
+++ b/rpython/jit/metainterp/logger.py
@@ -131,7 +131,7 @@
                 return 'ConstPtr(ptr' + str(mv) + ')'
             return 'ConstPtr(null)'
         elif isinstance(arg, ConstFloat):
-            return str(arg.getfloatstorage())
+            return str(arg.getfloat())
         elif arg is None:
             return 'None'
         elif arg.type == 'i':
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
@@ -2,7 +2,7 @@
 
 import py
 
-from rpython.jit.codewriter import heaptracker
+from rpython.jit.codewriter import heaptracker, longlong
 from rpython.jit.codewriter.effectinfo import EffectInfo
 from rpython.jit.codewriter.jitcode import JitCode, SwitchDictDescr
 from rpython.jit.metainterp import history, compile, resume, executor, jitexc
@@ -3013,7 +3013,7 @@
                     rop.GETARRAYITEM_RAW_F,
                                     [box_exchange_buffer,
                                      ConstInt(ofs // itemsize)],
-                                     0.0, descr)
+                                     longlong.ZEROF, descr)
             else:
                 assert kind == 'v'
                 continue
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
@@ -409,7 +409,7 @@
 
     type = 'f'
 
-    _resfloat = 0.0
+    _resfloat = longlong.ZEROF
 
     def getfloatstorage(self):
         return self._resfloat
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to