[pypy-commit] pypy default: Fix for test_sin_cos.

arigo noreply at buildbot.pypy.org
Fri Nov 11 19:11:23 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r49335:165f327efffa
Date: 2011-11-11 17:59 +0000
http://bitbucket.org/pypy/pypy/changeset/165f327efffa/

Log:	Fix for test_sin_cos.

diff --git a/pypy/module/pypyjit/test_pypy_c/model.py b/pypy/module/pypyjit/test_pypy_c/model.py
--- a/pypy/module/pypyjit/test_pypy_c/model.py
+++ b/pypy/module/pypyjit/test_pypy_c/model.py
@@ -285,6 +285,11 @@
             guard_false(ticker_cond1, descr=...)
         """
         src = src.replace('--EXC-TICK--', exc_ticker_check)
+        #
+        # ISINF is done as a macro; fix it here
+        r = re.compile('(\w+) = --ISINF--[(](\w+)[)]')
+        src = r.sub(r'\2\B999 = float_add(\2, ...)\n\1 = float_eq(\2\B999, \2)',
+                    src)
         return src
 
     @classmethod
diff --git a/pypy/module/pypyjit/test_pypy_c/test_math.py b/pypy/module/pypyjit/test_pypy_c/test_math.py
--- a/pypy/module/pypyjit/test_pypy_c/test_math.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_math.py
@@ -49,10 +49,7 @@
             guard_true(i2, descr=...)
             guard_not_invalidated(descr=...)
             f1 = cast_int_to_float(i0)
-            i3 = float_eq(f1, inf)
-            i4 = float_eq(f1, -inf)
-            i5 = int_or(i3, i4)
-            i6 = int_is_true(i5)
+            i6 = --ISINF--(f1)
             guard_false(i6, descr=...)
             f2 = call(ConstClass(sin), f1, descr=<FloatCallDescr>)
             f3 = call(ConstClass(cos), f1, descr=<FloatCallDescr>)
@@ -90,4 +87,4 @@
             i6 = int_sub(i0, 1)
             --TICK--
             jump(..., descr=)
-        """)
\ No newline at end of file
+        """)


More information about the pypy-commit mailing list