From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6153 Path: news.gmane.org!not-for-mail From: Sergey Dmitrouk Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Make musl math depend less on libgcc builtins Date: Thu, 11 Sep 2014 18:04:43 +0300 Message-ID: <20140911150443.GA5896@zx-spectrum> 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 1410447913 9956 80.91.229.3 (11 Sep 2014 15:05:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2014 15:05:13 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-6166-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 11 17:05:07 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 1XS5vf-0004VL-1P for gllmg-musl@plane.gmane.org; Thu, 11 Sep 2014 17:04:59 +0200 Original-Received: (qmail 31771 invoked by uid 550); 11 Sep 2014 15:04:58 -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 31762 invoked from network); 11 Sep 2014 15:04:57 -0000 Content-Disposition: inline In-Reply-To: <20140911141123.GL21835@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:6153 Archived-At: On Thu, Sep 11, 2014 at 07:11:23AM -0700, Szabolcs Nagy wrote: > musl checks for nan by if(y!=y) and my guess is that this is > incorrectly done by a signaling comparision I see vcmpe.f64 d0, d0 which seems to be part of "!isfinite(y)" expression, so your guess is correct ("vcmpe" instruction raises exceptions, "vcmp" doesn't). I also checked >, <, <= and >=, which Clang implements as "vcmpe" too. Linaro GCC 4.9 seems to do the correct thing for ARMhf. So different targets behave differently, maybe there is no flag to control this... > > 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..)