From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RDNS_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 23048 invoked from network); 22 Mar 2020 19:46:18 -0000 Received-SPF: pass (mother.openwall.net: domain of lists.openwall.com designates 195.42.179.200 as permitted sender) receiver=inbox.vuxu.org; client-ip=195.42.179.200 envelope-from= Received: from unknown (HELO mother.openwall.net) (195.42.179.200) by inbox.vuxu.org with ESMTP; 22 Mar 2020 19:46:18 -0000 Received: (qmail 13819 invoked by uid 550); 22 Mar 2020 19:46:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13801 invoked from network); 22 Mar 2020 19:46:16 -0000 Date: Sun, 22 Mar 2020 22:46:04 +0300 (MSK) From: Alexander Monakov To: musl@lists.openwall.com In-Reply-To: <20200322191019.GP11469@brightrain.aerifal.cx> Message-ID: References: <20200222195925.GK1663@brightrain.aerifal.cx> <20200223001942.GM1663@brightrain.aerifal.cx> <20200320181250.GC11469@brightrain.aerifal.cx> <20200322011958.GM11469@brightrain.aerifal.cx> <20200322175325.GO11469@brightrain.aerifal.cx> <20200322191019.GP11469@brightrain.aerifal.cx> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [musl] Q: dealing with missing removal of excess precision On Sun, 22 Mar 2020, Rich Felker wrote: > > Are you sure? single-precision sqrtf received a change just two days > > prior to that in commit e0a54e6725 ("correct rounding for i387 sqrtf function") > > which is the same day as when Stephen Canon supplied his answer in > > https://stackoverflow.com/questions/9678224/is-there-any-way-to-get-correct-rounding-with-the-i387-fsqrt-instruction > > (and also the same day you asked the question) > > I just dug through the old gcc and glibc bz's it was mentioned on > (52593 and 14032 resp.) and didn't find anything, but I'm pretty sure > it was known in 2012 that it was a non-issue for single-precision. > What I didn't understand then was that the callee was responsible for > dropping the excess precision; I wrongly believed that "something" in > the caller would make it not-matter/get collapsed down to nominal > precision and rounded correctly. Commit e0a54e6725 and related commits > were fixing that mistake, which I'd since recognized was wrong but > hadn't yet recognized the urgency of fixing until I started seeing how > bad it could break the compiler. Yes, that stackoverflow thread is also from 2012. Reading the question, it's clear that you are asking about both single and double precision (no indication you're aware that double-rounding would be safe for floats), then Stephen Canon answers, and soon after the aforementioned commit appears. Anyhow - thanks for the extra historical background. Alexander