Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.20.13.2003222022340.2534@monopod.intra.ispras.ru>
Date: Sun, 22 Mar 2020 20:40:19 +0300 (MSK)
From: Alexander Monakov <amonakov@...ras.ru>
To: musl@...ts.openwall.com
Subject: Re: Q: dealing with missing removal of excess precision

On Sat, 21 Mar 2020, Rich Felker wrote:

> 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?

Ack for x87 naming, fabsf fix and sqrt +0x300 fix.

Nack for sqrt 'unsigned short' fix, I recommend to consider
'unsigned fpsr = 0' and "+a" constraint, the resulting assembly is
much better (GCC doesn't seem to do a good job optimizing the 'unsigned short'
variant at all).

I also would like to see i386/sqrtf.c to explain why double rounding
is safe, either as a comment (my preference) or in the commit message.
I would write something like the following:

  The long double result has sufficient precision so that second rounding
  to float still keeps the returned value correctly rounded, see
  Pierre Roux, "Innocuous Double Rounding of Basic Arithmetic Operations".

(this paper elaborates the earlier [currently paywalled] paper by Figueroa)

Actually, may I ask why the initial commit did not mention that it relies
on this nontrivial property?

Thanks.
Alexander

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.