From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28930 invoked from network); 14 Aug 2021 04:07:56 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 14 Aug 2021 04:07:56 -0000 Received: (qmail 17745 invoked by uid 550); 14 Aug 2021 04:07:51 -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 17727 invoked from network); 14 Aug 2021 04:07:50 -0000 X-Authentication-Warning: key0.esi.com.au: damianm owned process doing -bs Date: Sat, 14 Aug 2021 14:07:34 +1000 (AEST) From: Damian McGuckin To: musl@lists.openwall.com In-Reply-To: Message-ID: References: <0C6AAAD55DA44C6189B2FF4F5FB2C3E7@H270> <20210810213455.GB37904@port70.net> <20210813155917.GE13220@brightrain.aerifal.cx> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Subject: Re: [musl] [PATCH #2] Properly simplified nextafter() On Fri, 13 Aug 2021, Stefan Kanthak wrote: >> It may be possible to reduce the number of such ops too; not sure. But >> there's no way to eliminate them. Replacing the second FORCE'd expression with FORCE((ux.f + x) * (0x1.0p-52 * 0.25)); eliminates one floating point OP, assuming the optimiser does the right thing to epsilon / 4 in the expression. Some preliminary testing seems to suggest that the same exceptions get raised. > It's definitely possible to do a strength reduction and get rid of the > multiplications. But then how is the exception still raised, or are we talking soft FP? Stay safe - Damian