From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6148 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Make musl math depend less on libgcc builtins Date: Thu, 11 Sep 2014 16:11:23 +0200 Message-ID: <20140911141123.GL21835@port70.net> References: <20140911073532.GA3179@zx-spectrum> <20140911094705.GF21835@port70.net> <20140911114207.GA5041@zx-spectrum> <20140911122651.GH21835@port70.net> <20140911132253.GA5487@zx-spectrum> 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 1410444707 27097 80.91.229.3 (11 Sep 2014 14:11:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2014 14:11:47 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6161-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 11 16:11:42 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 1XS560-0002uW-7D for gllmg-musl@plane.gmane.org; Thu, 11 Sep 2014 16:11:36 +0200 Original-Received: (qmail 17843 invoked by uid 550); 11 Sep 2014 14:11:35 -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 17835 invoked from network); 11 Sep 2014 14:11:35 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20140911132253.GA5487@zx-spectrum> User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:6148 Archived-At: * 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..)