On Sun, 15 Feb 2015, NightStrike wrote:
There are many builtin versions of various c99 functions. I find it difficult, however, to use them instead of the glibc equivalent, even when calling __builtin_xx directly.
Calling __builtin_* directly is generally useless.
Specifically in the case of fminf, under what conditions will gcc give me nice one-line branch-free assembly vs a call out to the library?
-ffinite-math-only or when the arguments are known at compile-time, see the source in gcc/builtins.c. -ffast-math is usually a good starting point to see if a math optimization is implemented.
-- Marc Glisse