[PATCH] Inline C99 math functions

Ondřej Bílka neleai@seznam.cz
Wed Jun 17 17:14:00 GMT 2015


On Wed, Jun 17, 2015 at 06:34:33PM +0200, Ondřej Bílka wrote:
 > 
> > I tried, but I don't think this is a good benchmark - you're not measuring
> > the FP->int move for the branched version, and you're comparing the signed
> > version of isinf vs the builtin which does isinf_ns.
> > 
> Wilco that isinf is signed is again completely irrelevant. gcc is smart.
> It get expanded into 
> if (foo ? (bar ? 1 : -1) : 0)
> that gcc simplifies to
> if (foo)
> so it doesn't matter that checking sign would take 100 cycles as its
> deleted code.
> 
Forgot to add that you should use gcc-4.9 or higher. I know that 4.7
doesn't do that and don't remember if 4.8 does that.



More information about the Libc-alpha mailing list