[pypy-svn] r35297 - in pypy/branch/jit-real-world/pypy: jit/codegen/i386/test rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Tue Dec 5 13:58:04 CET 2006


Author: arigo
Date: Tue Dec  5 13:58:02 2006
New Revision: 35297

Modified:
   pypy/branch/jit-real-world/pypy/jit/codegen/i386/test/test_operation.py
   pypy/branch/jit-real-world/pypy/rpython/lltypesystem/lloperation.py
Log:
A skipped test about floats (for later).


Modified: pypy/branch/jit-real-world/pypy/jit/codegen/i386/test/test_operation.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/jit/codegen/i386/test/test_operation.py	(original)
+++ pypy/branch/jit-real-world/pypy/jit/codegen/i386/test/test_operation.py	Tue Dec  5 13:58:02 2006
@@ -192,3 +192,22 @@
             fp = self.rgen(fn, [r_uint, r_uint])
             assert fp(40, 2) == fn(40, 2)
             assert fp(25, 3) == fn(25, 3)
+
+    def test_float_arithmetic(self):
+        py.test.skip("floats in codegen/i386")
+        for fn in [lambda x, y: bool(y),
+                   lambda x, y: bool(y - 2.0),
+                   lambda x, y: x + y,
+                   lambda x, y: x - y,
+                   lambda x, y: x * y,
+                   lambda x, y: x / y,
+                   #lambda x, y: x % y,     not used?
+                   lambda x, y: x ** y,
+                   lambda x, y: -y,
+                   lambda x, y: ~y,
+                   lambda x, y: abs(y),
+                   lambda x, y: abs(-x),
+                   ]:
+            fp = self.rgen(fn, [float, float])
+            assert fp(40.0, 2.0) == fn(40.0, 2.0)
+            assert fp(25.125, 1.5) == fn(25.125, 1.5)

Modified: pypy/branch/jit-real-world/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/branch/jit-real-world/pypy/rpython/lltypesystem/lloperation.py	Tue Dec  5 13:58:02 2006
@@ -217,8 +217,8 @@
     'float_ne':             LLOp(canfold=True),
     'float_gt':             LLOp(canfold=True),
     'float_ge':             LLOp(canfold=True),
-    'float_floor':          LLOp(canfold=True),
-    'float_fmod':           LLOp(canfold=True),
+    'float_floor':          LLOp(canfold=True),    # XXX not used?
+    'float_fmod':           LLOp(canfold=True),    # XXX not used?
     'float_pow':            LLOp(canfold=True),
 
     'llong_is_true':        LLOp(canfold=True),



More information about the Pypy-commit mailing list