[pypy-svn] r35711 - in pypy/dist/pypy: rpython/lltypesystem translator/cli translator/js translator/jvm translator/squeak

arigo at codespeak.net arigo at codespeak.net
Wed Dec 13 23:22:21 CET 2006


Author: arigo
Date: Wed Dec 13 23:22:17 2006
New Revision: 35711

Modified:
   pypy/dist/pypy/rpython/lltypesystem/lloperation.py
   pypy/dist/pypy/rpython/lltypesystem/opimpl.py
   pypy/dist/pypy/translator/cli/opcodes.py
   pypy/dist/pypy/translator/js/opcodes.py
   pypy/dist/pypy/translator/jvm/opcodes.py
   pypy/dist/pypy/translator/squeak/opformatter.py
Log:
issue192 resolved

Remove the three obscure float operations that were never produced anyway.


Modified: pypy/dist/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/lloperation.py	Wed Dec 13 23:22:17 2006
@@ -114,10 +114,9 @@
 # ____________________________________________________________
 #
 # This list corresponds to the operations implemented by the LLInterpreter.
-# XXX Some clean-ups are needed:
-#      * many exception-raising operations are being replaced by calls to helpers
-#      * float_mod vs float_fmod ?
-# Run test_lloperation after changes.  Feel free to clean up LLInterpreter too :-)
+# Note that many exception-raising operations are being replaced by calls
+# to helpers by rpython/raisingops/.
+# ***** Run test_lloperation after changes. *****
 
 LL_OPERATIONS = {
 
@@ -210,15 +209,12 @@
     'float_sub':            LLOp(canfold=True),
     'float_mul':            LLOp(canfold=True),
     'float_truediv':        LLOp(canfold=True),
-    'float_mod':            LLOp(canfold=True),
     'float_lt':             LLOp(canfold=True),
     'float_le':             LLOp(canfold=True),
     'float_eq':             LLOp(canfold=True),
     'float_ne':             LLOp(canfold=True),
     'float_gt':             LLOp(canfold=True),
     'float_ge':             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),

Modified: pypy/dist/pypy/rpython/lltypesystem/opimpl.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/opimpl.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/opimpl.py	Wed Dec 13 23:22:17 2006
@@ -232,15 +232,6 @@
     assert -sys.maxint-1 <= b <= sys.maxint
     return int(b)
 
-def op_float_floor(b):
-    assert type(b) is float
-    return math.floor(b)
-
-def op_float_fmod(b,c):
-    assert type(b) is float
-    assert type(c) is float
-    return math.fmod(b,c)
-
 def op_float_pow(b,c):
     assert type(b) is float
     assert type(c) is float

Modified: pypy/dist/pypy/translator/cli/opcodes.py
==============================================================================
--- pypy/dist/pypy/translator/cli/opcodes.py	(original)
+++ pypy/dist/pypy/translator/cli/opcodes.py	Wed Dec 13 23:22:17 2006
@@ -154,15 +154,12 @@
     'float_sub':                'sub',
     'float_mul':                'mul',
     'float_truediv':            'div', 
-    'float_mod':                'rem',
     'float_lt':                 'clt',
     'float_le':                 _not('cgt'),
     'float_eq':                 'ceq',
     'float_ne':                 _not('ceq'),
     'float_gt':                 'cgt',
     'float_ge':                 _not('clt'),
-    'float_floor':              None, # TODO
-    'float_fmod':               None, # TODO
 
     'llong_is_true':            [PushAllArgs, 'ldc.i8 0', 'cgt.un'],
     'llong_neg':                'neg',

Modified: pypy/dist/pypy/translator/js/opcodes.py
==============================================================================
--- pypy/dist/pypy/translator/js/opcodes.py	(original)
+++ pypy/dist/pypy/translator/js/opcodes.py	Wed Dec 13 23:22:17 2006
@@ -82,7 +82,6 @@
     'float_add': '+',
     'float_sub': '-',
     'float_truediv': '/',
-    'float_mod': '%',
     'float_lt': '<',
     'float_le': '<=',
     'float_eq': '==',

Modified: pypy/dist/pypy/translator/jvm/opcodes.py
==============================================================================
--- pypy/dist/pypy/translator/jvm/opcodes.py	(original)
+++ pypy/dist/pypy/translator/jvm/opcodes.py	Wed Dec 13 23:22:17 2006
@@ -141,15 +141,12 @@
     'float_sub':                jvmgen.DSUB,
     'float_mul':                jvmgen.DMUL,
     'float_truediv':            jvmgen.DDIV, 
-    'float_mod':                jvmgen.DREM, # use Math.IEEEremainder?
     'float_lt':                 'dbl_less_than',     
     'float_le':                 'dbl_less_equals',   
     'float_eq':                 'dbl_equals',        
     'float_ne':                 'dbl_not_equals',    
     'float_gt':                 'dbl_greater_than',  
     'float_ge':                 'dbl_greater_equals',
-    'float_floor':              jvmgen.MATHFLOOR,
-    'float_fmod':               jvmgen.DREM, # DREM is akin to fmod() in C
 
     'llong_is_true':            [PushAllArgs,
                                  jvmgen.LCONST_0,

Modified: pypy/dist/pypy/translator/squeak/opformatter.py
==============================================================================
--- pypy/dist/pypy/translator/squeak/opformatter.py	(original)
+++ pypy/dist/pypy/translator/squeak/opformatter.py	Wed Dec 13 23:22:17 2006
@@ -32,8 +32,6 @@
         'bool_not':    'not',
 
         'cast_int_to_float': 'asFloat',
-        'float_fmod':  r'\\', # we can't really distinguish mod and fmod
-        'float_floor': 'floor',
         # XXX this potentially incorrect (may return LargeIntegers)
         'cast_float_to_int': 'truncated',
     }



More information about the Pypy-commit mailing list