builtin c99 functions

Marc Glisse marc.glisse@inria.fr
Sun Feb 15 22:41:00 GMT 2015


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



More information about the Gcc-help mailing list