This is the mail archive of the
mailing list for the glibc project.
Re: Fix fmod for subnormals (bug 14048)
- From: David Miller <davem at davemloft dot net>
- To: joseph at codesourcery dot com
- Cc: libc-alpha at sourceware dot org, carlos at systemhalted dot org
- Date: Mon, 28 May 2012 21:15:14 -0400 (EDT)
- Subject: Re: Fix fmod for subnormals (bug 14048)
- References: <Pine.LNX.firstname.lastname@example.org>
From: "Joseph S. Myers" <email@example.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
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.