[pypy-dev] msvc and floating point compiler flags

Matti Picus matti.picus at gmail.com
Thu Apr 10 00:00:34 CEST 2014


To answer my own question:
It seems cpython, pypy.exe and jitted code (for both msvc and gcc) all
use a floating point model that correctly can do == for doubles. The
failure is only in the zmath jit backend test. I am now looking for how
the test sets up a floating point precision model that is not only
triggers the failure, but is inconsistent with translation.
Matti

On 9/04/2014 11:10 PM, matti picus wrote:
> looking at this test failure
> http://buildbot.pypy.org/summary/longrepr?testname=test_math&builder=own-win-x86-32&build=86&mod=jit.backend.x86.test.test_zmath
> which tests that atan2(0.23/1.23) == 1.3.... via OP_FLOAT_EQ(double
> value, double value)
> OP_FLOAT_EQ is a compiler define to (a == b), which is tricky with
> double values.
> Here is a nice discussion of the issue on MSVC
> http://www.gamasutra.com/view/news/167402/Indepth_Intermediate_floatingpoint_precision.php
> The link even has a flow chart for choosing msvc or intel compiler flags.
> The test passes if I add /fp:fast to the msvc compile flag
> Would anyone object if I add this to the default MSVC flags?
> 
> FWIW, the "fast" is misleading, apparently it can be slower than the
> default for some cases.
> Matti


More information about the pypy-dev mailing list