This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix bad shift in soft-fp (bug 7006)
- From: Richard Henderson <rth at twiddle dot net>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org, ilyes dot gouta at gmail dot com, rth at gcc dot gnu dot org
- Date: Fri, 21 Jun 2013 10:31:40 -0700
- Subject: Re: Fix bad shift in soft-fp (bug 7006)
- References: <Pine dot LNX dot 4 dot 64 dot 1306180134170 dot 26161 at digraph dot polyomino dot org dot uk>
On 06/17/2013 06:38 PM, Joseph S. Myers wrote:
> My conclusion for this glibc bug is that it's best to disallow shift
> counts of 0 for these soft-fp macros, since almost all calls to them
> cannot have such a count, but it may not always be possible for GCC to
> optimize away any workaround to avoid shifting by _FP_W_TYPE_SIZE in
> cases where the shift count is not a constant. This patch accordingly
> changes the one case I found could use a shift count of 0 to check at
> the call site.
It seems reasonable.
The vast majority of shifts are constant. The next most common are
canonicalization shifts, with the input coming from CLZ+C. In general
there we already know that C != 0, so some shift must occur.
> I'd welcome review of the conclusion that none of the other calls to
> the shift macros in soft-fp can actually have an argument of 0, as
> well as of this specific patch.
I had a look through op-common.h and I don't see anything else that
isn't either known non-zero or already checked.
r~