This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix bad shift in soft-fp (bug 7006)


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]