Fix fmod for subnormals (bug 14048)

David Miller davem@davemloft.net
Tue May 29 09:16:00 GMT 2012


From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Mon, 28 May 2012 23:53:43 +0000 (UTC)

> (I'd think all these fmod/fmodf/fmodl implementations would be better
> using __builtin_clz / __builtin_clzll to find the exponents of
> subnormals, but such an optimization is a separate issue and probably
> shouldn't be backported to 2.15.)

I notice this kind of scheme used in the soft-fp code too.

However, this generates terrible code on sparc which lacks any kind of
clz instructions until very recently.  It's mainly calls to libgcc and
C implementations unless you explicitly compile targetting very recent
cpus.

In these cases where I see it used, some knowledge of the input data
could be used to speed things up compared to what the clz builtins
ends up doing.



More information about the Libc-alpha mailing list