[llvm-dev] [cfe-dev] [test-suite] making polybench/symm succeed with "-Ofast" and "-ffp-contract=on"

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 12 08:10:36 PDT 2016


On 12 October 2016 at 15:37, Joerg Sonnenberger via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> That is plainly wrong and a very common misconception about floating
> point. A very good example for something that is *required* to give the
> very same result all the time is strtod. If a compiler change results in
> different output, it is a bug. It is surprisingly difficult to ensure
> that, but yes, there are floating point routines where absolute no
> change must be added.

That was a general remark, not an absolute one as both you and Hal
interpreted as. :)

But I'll repeat my response to Hal: Not all hardwares / systems are
the same. For example, Darwin has -ffast-math always enabled, so O3
will produce different results than O0.

I have added a lot of extra logic to the tests to minimise the
uncertainties, for example not relying on the platform's libraries for
printing, trigonometric or RNG functions, sampling results, etc. in
order to reduce the variability *across* platforms.

The reference_output is per test for all platforms, not per platform.

cheers,
--renato


More information about the llvm-dev mailing list