From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6154 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Make musl math depend less on libgcc builtins Date: Thu, 11 Sep 2014 19:14:50 +0400 (MSK) Message-ID: References: <20140911073532.GA3179@zx-spectrum> <20140911094705.GF21835@port70.net> <20140911114207.GA5041@zx-spectrum> <20140911122651.GH21835@port70.net> <20140911132253.GA5487@zx-spectrum> <20140911141123.GL21835@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: ger.gmane.org 1410448613 19925 80.91.229.3 (11 Sep 2014 15:16:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2014 15:16:53 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6167-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 11 17:16:48 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XS674-0004JT-UN for gllmg-musl@plane.gmane.org; Thu, 11 Sep 2014 17:16:47 +0200 Original-Received: (qmail 7936 invoked by uid 550); 11 Sep 2014 15:16:46 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7928 invoked from network); 11 Sep 2014 15:16:46 -0000 In-Reply-To: <20140911141123.GL21835@port70.net> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) Xref: news.gmane.org gmane.linux.lib.musl.general:6154 Archived-At: On Thu, 11 Sep 2014, Szabolcs Nagy wrote: > * Sergey Dmitrouk [2014-09-11 16:22:53 +0300]: > > Note that I'm performing tests in QEMU. vsqrt.f64 instruction returns > > NAN for NAN input and doesn't raise any exceptions ($fpscr register is > > unchanged). However I get INVALID exception after printing result with > > musl implementation of printf(), glibc doesn't raise any exceptions in > > printf(), but I'm not sure whether it's important, probably not. > > nan printf should not raise invalid exceptino in musl either > > musl checks for nan by if(y!=y) and my guess is that this is > incorrectly done by a signaling comparision > > i checked on x86_64 and both clang and gcc get comparisions > wrong in the other direction: they use quite comparisions > when signaling is needed, eg > > http://goo.gl/GsdpZA > > (on a correct implementation ==, != are quiet, but <,>,<=,>= > raise invalid if any of the operands are nan, on x86_64 the > quiet instruction is ucomis* and the signaling one is comis* > and both gcc-4.9 and clang-3.4 seem to use ucomis* for all > relational operations, may be there is some compiler flag to > make them behave..) In GCC, -mno-ieee-fp will switch ucom->com it for both == and <>. Is that still wrong? Shouldn't there be a GCC bug filed? Alexander