Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 21 Mar 2020 21:19:58 -0400
From: Rich Felker <>
Subject: Re: Q: dealing with missing removal of excess precision

On Fri, Mar 20, 2020 at 02:12:50PM -0400, Rich Felker wrote:
> On Sun, Feb 23, 2020 at 07:14:08PM +0300, Alexander Monakov wrote:
> > On Sat, 22 Feb 2020, Rich Felker wrote:
> > 
> > > I'm not well acquainted with SSE, and only so-so with x87, so pretty
> > > much I'm reading them for higher-level issues with tooling
> > > compatibility (like the concerns I already raised and looked up and
> > > seem to have resolved about x87 constraints and non-GCC compilers) and
> > > logic, then planning to apply and test them. I think being aware of
> > > non-obvious mistake modes that have already been found would be a lot
> > > more useful than staring at things, especially if the bugs you've
> > > found are in subtleties of the insn behavior or constraint behavior.
> > 
> > Okay, thanks. I found two issues:
> > 
> > 1. i386 lrint* functions mistakenly used fistpll instead of fistpl (I
> > posted the fix for x32 asm after noticing my own mistake).
> > 
> > 2. Some functions bind a 32-bit lvalue as output for fnstsw %ax, which
> > as the operand says writes only 16 bits. They should be changed to either
> > use a 16-bit lvalue, or a zero-initialized 32-bit lvalue with "+a" constraint.
> > 
> > Plus, not bugs, but still worth mentioning:
> > 
> > 3. The new remquol in C could alternatively be implemented by using fxam
> > to extract sign bits instead of loading them from stack slots. The current
> > approach makes sense given the ABI, but an implementation aiming for better
> > code after inlining could choose to use fxam instead of forcing a spill.
> > 
> > 4. I did not manage to find a copy of Figueroa's "When is double rounding
> > innocuous", but I could cite e.g. "Innocuous Double Rounding of Basic
> > Arithmetic Operations" by Pierre Roux instead (in i386/sqrtf.c).
> > 
> > If you like you can fetch a Git tree with my patches from 
> > 
> >
> > 
> > (issue 1 is already corrected in that repo)
> Hi. I'm trying to catch up on this and other patches after being sick
> and not getting much done for a while. Is there anything else I should
> be aware of before going forward with these?
> One minor cosmetic change I'd like to make to commit names if you
> don't object is changing "x86-family" to "x87-family" for the commits
> that are "i386 + long double functions on x86_64" since I found it
> confusing when there's one commit for "x86 family" then a separate one
> for x86_64 versions of the same function. Let me know if you think of
> any alternative that might be more clear than "x87"

With the fixups mentioned (included in attached patches), i386 and
x86_64 are passing libc-test and seem fine. OK if I merge them
(rebasing the fixups in as fixups)? With s/x86/x87/ naming?


View attachment "0001-fabsf-i386-fixup.patch" of type "text/plain" (553 bytes)

View attachment "0002-sqrt-i386-fixup.patch" of type "text/plain" (748 bytes)

View attachment "0003-sqrt-i386-fixup-2.patch" of type "text/plain" (651 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.