On Friday, 5 August 2016 at 09:21:53 UTC, Ilya Yaroshenko wrote:
On Friday, 5 August 2016 at 08:43:48 UTC, deadalnix wrote:
On Friday, 5 August 2016 at 08:17:00 UTC, Ilya Yaroshenko
wrote:
1. Could you please provide an assembler example with clang
or recent gcc?
I have better: compile your favorite project with
-Wdouble-promotion and enjoy the rain of warnings.
But try it yourself:
float foo(float a, float b) {
return 3.0 * a / b;
}
Your example is just a speculation. 3.0 force compiler to
convert a and b to double. This is obvious.
Ha you are right.
Testing more it seems that gcc and clang are not promoting on 64
bit code, but still are on 32 bits.