From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13895 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: FE Exception triggered by comparison Date: Wed, 27 Feb 2019 21:16:09 +0100 Message-ID: <20190227201608.GH21289@port70.net> References: <20190227164225.GV23599@brightrain.aerifal.cx> <20190227172641.GW23599@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="202195"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) To: musl@lists.openwall.com Original-X-From: musl-return-13911-gllmg-musl=m.gmane.org@lists.openwall.com Wed Feb 27 21:16:24 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1gz5ct-000qTC-Fi for gllmg-musl@m.gmane.org; Wed, 27 Feb 2019 21:16:23 +0100 Original-Received: (qmail 19899 invoked by uid 550); 27 Feb 2019 20:16:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 19879 invoked from network); 27 Feb 2019 20:16:20 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:13895 Archived-At: * Alexander Monakov [2019-02-27 22:48:02 +0300]: > On Wed, 27 Feb 2019, Rich Felker wrote: > > Ideally the compiler would be able to recognize portable (within IEEE) > > patterns for floating point representation examination and optimize > > them if there's a more efficient way to be able to do it for a > > particular machine. > > There's a difference for sNaN operands: the bit-test version obviously > is not going to raise "invalid", while comparing the fpu register with > itself will. So I'm afraid the compiler wouldn't do that for x86 (but > could for targets where an suitable instruction is available). using -fsignaling-nan is extremely rare, by default the transformation is valid (but maybe tricky anyway).