[pypy-svn] r43733 - in pypy/dist/pypy: rpython/lltypesystem rpython/test translator/cli

antocuni at codespeak.net antocuni at codespeak.net
Sun May 27 18:17:02 CEST 2007


Author: antocuni
Date: Sun May 27 18:17:00 2007
New Revision: 43733

Modified:
   pypy/dist/pypy/rpython/lltypesystem/opimpl.py
   pypy/dist/pypy/rpython/test/test_rfloat.py
   pypy/dist/pypy/translator/cli/opcodes.py
Log:
test for float**float, missing import in opimpl.py and support for it
in gencli



Modified: pypy/dist/pypy/rpython/lltypesystem/opimpl.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/opimpl.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/opimpl.py	Sun May 27 18:17:00 2007
@@ -1,4 +1,5 @@
 import sys
+import math
 from pypy.tool.sourcetools import func_with_new_name
 from pypy.rpython.lltypesystem import lltype, llmemory
 from pypy.rpython.lltypesystem.lloperation import opimpls

Modified: pypy/dist/pypy/rpython/test/test_rfloat.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rfloat.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rfloat.py	Sun May 27 18:17:00 2007
@@ -102,6 +102,12 @@
         res = self.interpret(fn, [])
         assert res == 42.0
 
+    def test_pow(self):
+        def fn(x, y):
+            return x**y
+        res = self.interpret(fn, [2.0, 3.0])
+        assert res == 8.0
+
 class TestLLtype(BaseTestRfloat, LLRtypeMixin):
 
     def test_hash(self):

Modified: pypy/dist/pypy/translator/cli/opcodes.py
==============================================================================
--- pypy/dist/pypy/translator/cli/opcodes.py	(original)
+++ pypy/dist/pypy/translator/cli/opcodes.py	Sun May 27 18:17:00 2007
@@ -164,7 +164,8 @@
     'float_ne':                 _not('ceq'),
     'float_gt':                 'cgt',
     'float_ge':                 _not('clt'),
-
+    'float_pow':                [PushAllArgs, 'call float64 [mscorlib]System.Math::Pow(float64, float64)'],
+   
     'llong_is_true':            [PushAllArgs, 'ldc.i8 0', 'cgt.un'],
     'llong_neg':                'neg',
     'llong_neg_ovf':            _check_ovf(['ldc.i8 0', PushAllArgs, 'sub.ovf', StoreResult]),



More information about the Pypy-commit mailing list