On 20 March 2013 08:11, Kristof Beyls <Kristof.Beyls@arm.com> wrote:

·         Does this result in non-compliance of IEEE754 regarding denormals? NaN? INFs? Something else?


Yes, but only slightly. ;)

I don't want to treat this question as black and white because the penalty is severe, but I also don't want people looking at the generated code and thinking (as I did) that LLVM is doing it wrong.


·         Also, does the C/C++ standard say something about IEEE 754 compliance?


This has little to do with Clang, C, C++ or OpenCL. The IR is the same for every language and they all lower to fmul in the end. It depends on what we want to do in the ARM back-end by default.

There are flags that the compiler can turn on and off, but this is a question of what should the *default* be? Clang is not passing any flag because the hidden contract with the LLVM back-end is that LLVM does what Clang expects.

As Mans says, C99 (and C11) do require 754 compatibility (I couldn't find any strict requirement on C++11 but there could be one), and that's up to the Clang folks to make sure they pass the exact flags to the back-end.

From Perer and Mans answers, and my own opinion, I think we should be strict and require unsafe-math for NEON f32, at least for *EABI (ie. option 1).

If no one else objects, I'll make that change next week.

cheers,
--renato