For people who wonder even more about taking the maximum of two floats: let's
compare fmax(a,b)
, fmaxf(a,b)
, std::max(a,b)
and if (a < b) return b; else return a;
in gcc, clang, icc and msvc.
Look at the assembler outputs here: gcc and clang (https://godbolt.org/z/a1pb5N), icc and mscv (https://godbolt.org/z/FoH15I).
Results:
. | CLANG | GCC | ICC | MSVC