[pypy-svn] r53191 - in pypy/branch/jit-hotpath/pypy/jit/codegen: i386 ia32 ia32/test

arigo at codespeak.net arigo at codespeak.net
Mon Mar 31 10:14:19 CEST 2008


Author: arigo
Date: Mon Mar 31 10:14:19 2008
New Revision: 53191

Modified:
   pypy/branch/jit-hotpath/pypy/jit/codegen/i386/ri386setup.py
   pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
   pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/test/test_operation.py
Log:
Fix by generating the same code as gcc.


Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/i386/ri386setup.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/i386/ri386setup.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/i386/ri386setup.py	Mon Mar 31 10:14:19 2008
@@ -434,6 +434,9 @@
 BREAKPOINT.mode0(['\xCC'])
 BREAKPOINT.as_alias = "INT3"
 
+SAHF = Instruction()
+SAHF.mode0(['\x9E'])
+
 # ------------------------- floating point instructions ------------------
 
 FLDL = Instruction()

Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py	Mon Mar 31 10:14:19 2008
@@ -630,10 +630,9 @@
 
     def returnboolfloatvar(self):
         self.mc.FSTSW()
-        self.mc.OR(eax, imm(4))     # ???
-        res = BoolVar(self.stackdepth)
-        self.push(eax)
-        return res
+        self.mc.SAHF()
+        self.mc.SETNZ(al)
+        return self.returnboolvar(al)
 
     def returnfloatvar(self, op):
         res = FloatVar(self.stackdepth + 1)

Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/test/test_operation.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/test/test_operation.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/test/test_operation.py	Mon Mar 31 10:14:19 2008
@@ -44,9 +44,6 @@
     RGenOp = RGenOpPacked
 
 class TestOperation(I386TestMixin, OperationTests):
-    def test_float_cast(self):
-        py.test.skip("looks bogus to me")
-
     def test_ptr_comparison(self):
         py.test.skip('unsupported')
 



More information about the Pypy-commit mailing list