<br><br><div class="gmail_quote">On Sun, Oct 16, 2011 at 5:21 PM, Armin Rigo <span dir="ltr"><<a href="mailto:arigo@tunes.org">arigo@tunes.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi David,<br>
<br>
On Sun, Oct 16, 2011 at 19:13, David Cournapeau <<a href="mailto:cournape@gmail.com">cournape@gmail.com</a>> wrote:<br>
> (...) and there is also the issue<br>
<div class="im">> of correctness in floating point code generation. Given that<br>
> decade-old compilers get it wrong, I would expect pypy jit to have<br>
> quite a few funky corner cases as well.<br>
<br>
</div>No, we should not have corner cases, because we don't go there at all.<br>
We know very well that rewriting operations on floats can slightly<br>
change their results, so we don't do it. In other words the JIT<br>
produces a sequence of residual operations that has bit-wise the same<br>
effect as the original sequence of Python operations.<br>
<br>
(More precisely, it seems that we only replace FLOAT_MUL(x, 1.0) by<br>
"x" and FLOAT_MUL(x, -1.0) by "-x", as well as simplify repeated<br>
FLOAT_NEG's and assume that FLOAT_MUL's are commutative. As far as I<br>
can tell these trivial optimizations are all bit-wise correct, at<br>
least on modern FPUs.)<br>
<br>
<br>
A bientôt,<br>
<font color="#888888"><br>
Armin.<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
pypy-dev mailing list<br>
<a href="mailto:pypy-dev@python.org">pypy-dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pypy-dev" target="_blank">http://mail.python.org/mailman/listinfo/pypy-dev</a><br>
</div></div></blockquote></div><br>I should note that I wrote all of these operations by verifying that GCC would do them, as well as testing on obscure values. Note for example that we don't constant fold x + 0.0 (changes the sign of x at x== -0.0).<div>
<br></div><div>ALex<br clear="all"><div><br></div>-- <br>"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)<br>"The people's good is the highest law." -- Cicero<br>
<br>
</div>