From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14993 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: [updated/fixed] Patches for math subtree Date: Wed, 11 Dec 2019 10:37:15 +0100 Message-ID: <20191211093714.GI23985@port70.net> References: 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="52888"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: musl@lists.openwall.com To: Stefan Kanthak Original-X-From: musl-return-15009-gllmg-musl=m.gmane.org@lists.openwall.com Wed Dec 11 10:37:32 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 1ieyR0-000Da8-02 for gllmg-musl@m.gmane.org; Wed, 11 Dec 2019 10:37:30 +0100 Original-Received: (qmail 10178 invoked by uid 550); 11 Dec 2019 09:37:27 -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 10156 invoked from network); 11 Dec 2019 09:37:26 -0000 Mail-Followup-To: Stefan Kanthak , musl@lists.openwall.com Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:14993 Archived-At: * Stefan Kanthak [2019-12-10 17:56:51 +0100]: > > Just some optimisations. thanks for the patches. i think optimizing |x|<1 is not very important. c99 allowed 2 fenv behaviours, we (and fdlibm) choose one, c2x went with the other: no inexact exception is allowed. so if i touch this code i would rewrite it with int arithmetics (which will be slower on most hard float targets than the current code anyway) > > JFTR: I'm NOT subscribed to your mailing list, so CC: me in replies! > > [ Patch for remquo unchanged ] > > --- -/src/math/ceil.c > +++ +/src/math/ceil.c > @@ -18,10 +18,10 @@ > + /* special case because of non-nearest rounding modes */ > + if (e < 0x3ff) { > + FORCE_EVAL(x + toint); > + return u.i >> 63 ? -0.0 : 1.0; > + } > /* y = int(x) - x, where int(x) is an integer neighbor of x */ > if (u.i >> 63) > y = x - toint + toint - x; > else > y = x + toint - toint - x; > - /* special case because of non-nearest rounding modes */ > - if (e <= 0x3ff-1) { > - FORCE_EVAL(y); > - return u.i >> 63 ? -0.0 : 1; > - } > > --- -/src/math/floor.c > +++ +/src/math/floor.c > @@ -18,10 +18,10 @@ > + /* special case because of non-nearest rounding modes */ > + if (e < 0x3ff) { > + FORCE_EVAL(x + toint); > + return u.i >> 63 ? -1.0 : 0.0; > + } > /* y = int(x) - x, where int(x) is an integer neighbor of x */ > if (u.i >> 63) > y = x - toint + toint - x; > else > y = x + toint - toint - x; > - /* special case because of non-nearest rounding modes */ > - if (e <= 0x3ff-1) { > - FORCE_EVAL(y); > - return u.i >> 63 ? -1 : 0; > - }