[pypy-svn] r45960 - in pypy/branch/pypy-more-rtti-inprogress: annotation rpython rpython/lltypesystem rpython/test translator/c/src

fijal at codespeak.net fijal at codespeak.net
Fri Aug 24 18:42:05 CEST 2007


Author: fijal
Date: Fri Aug 24 18:42:05 2007
New Revision: 45960

Modified:
   pypy/branch/pypy-more-rtti-inprogress/annotation/binaryop.py
   pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/lloperation.py
   pypy/branch/pypy-more-rtti-inprogress/rpython/rfloat.py
   pypy/branch/pypy-more-rtti-inprogress/rpython/test/test_rfloat.py
   pypy/branch/pypy-more-rtti-inprogress/translator/c/src/float.h
Log:
Revert float % float, as arigo suggested


Modified: pypy/branch/pypy-more-rtti-inprogress/annotation/binaryop.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/annotation/binaryop.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/annotation/binaryop.py	Fri Aug 24 18:42:05 2007
@@ -419,7 +419,7 @@
     def union((flt1, flt2)):
         return SomeFloat()
 
-    mod = add = sub = mul = div = truediv = union
+    add = sub = mul = div = truediv = union
 
     def pow((flt1, flt2), obj3):
         return SomeFloat()

Modified: pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/rpython/lltypesystem/lloperation.py	Fri Aug 24 18:42:05 2007
@@ -234,7 +234,6 @@
     'float_gt':             LLOp(canfold=True),
     'float_ge':             LLOp(canfold=True),
     'float_pow':            LLOp(canfold=True),
-    'float_mod':            LLOp(canfold=True),
 
     'llong_is_true':        LLOp(canfold=True),
     'llong_neg':            LLOp(canfold=True),

Modified: pypy/branch/pypy-more-rtti-inprogress/rpython/rfloat.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/rpython/rfloat.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/rpython/rfloat.py	Fri Aug 24 18:42:05 2007
@@ -47,11 +47,6 @@
 
     rtype_inplace_truediv = rtype_truediv
 
-    def rtype_mod(_, hop):
-        return _rtype_template(hop, 'mod')
-
-    rtype_inplace_mod = rtype_mod
-
     # turn 'div' on floats into 'truediv'
     rtype_div         = rtype_truediv
     rtype_inplace_div = rtype_inplace_truediv

Modified: pypy/branch/pypy-more-rtti-inprogress/rpython/test/test_rfloat.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/rpython/test/test_rfloat.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/rpython/test/test_rfloat.py	Fri Aug 24 18:42:05 2007
@@ -108,12 +108,6 @@
         res = self.interpret(fn, [2.0, 3.0])
         assert res == 8.0
 
-    def test_float_mod(self):
-        def fn(x, y):
-            return x % y
-        res = self.interpret(fn, [2.33, 1.0])
-        assert res - 0.33 < 0.00000000001
-
 class TestLLtype(BaseTestRfloat, LLRtypeMixin):
 
     def test_hash(self):

Modified: pypy/branch/pypy-more-rtti-inprogress/translator/c/src/float.h
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/translator/c/src/float.h	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/translator/c/src/float.h	Fri Aug 24 18:42:05 2007
@@ -28,7 +28,6 @@
 #define OP_FLOAT_MUL(x,y,r)     r = x * y
 #define OP_FLOAT_TRUEDIV(x,y,r) r = x / y
 #define OP_FLOAT_POW(x,y,r)     r = pow(x, y) 
-#define OP_FLOAT_MOD(x,y,r)     r = fmod(x, y)
 
 /*** conversions ***/
 



More information about the Pypy-commit mailing list