From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/615 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: libm Date: Mon, 5 Mar 2012 16:17:11 +0100 Message-ID: <20120305151710.GG5728@port70.net> References: <20120123164152.GZ31975@port70.net> <20120123170715.GA197@brightrain.aerifal.cx> <20120227210253.GA25004@port70.net> <20120227222437.GH184@brightrain.aerifal.cx> <20120303225758.GA5728@port70.net> <20120304065340.GT184@brightrain.aerifal.cx> <20120304145041.GB5728@port70.net> <20120304184339.GV184@brightrain.aerifal.cx> <20120305085135.GC5728@port70.net> <20120305140459.GW184@brightrain.aerifal.cx> 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: dough.gmane.org 1330960646 18708 80.91.229.3 (5 Mar 2012 15:17:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 5 Mar 2012 15:17:26 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-616-gllmg-musl=m.gmane.org@lists.openwall.com Mon Mar 05 16:17:25 2012 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 1S4Zf9-00036b-MG for gllmg-musl@plane.gmane.org; Mon, 05 Mar 2012 16:17:23 +0100 Original-Received: (qmail 7487 invoked by uid 550); 5 Mar 2012 15:17:23 -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 7479 invoked from network); 5 Mar 2012 15:17:22 -0000 Content-Disposition: inline In-Reply-To: <20120305140459.GW184@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:615 Archived-At: * Rich Felker [2012-03-05 09:04:59 -0500]: > On Mon, Mar 05, 2012 at 09:51:35AM +0100, Szabolcs Nagy wrote: > Hm? If you need a macro to test whether an argument is an integer or > floating point, try this: > > #define __IS_FP(x) !!((1?1:(x))/2) > oh nice (and subtle) > I can do it, but might be another day or two. Feel free to keep fixing > stuff up in the mean time if you have time. :) > ok > > i saw that you removed the compound literal definition of > > NAN, INFINITY etc from math.h > > > > The removal has nothing to do with c89; it's actually the fact that > the compound literal definition was not a constant expression and the > standard requires these macros to expand to constant expressions. > i see > adopted it. In any case I see no good way to define them without > compound literals except the function calls.. > btw while testing these macros i noticed that when multiple classification macros are used fpclassify gets called many times (with the previous solution) the extra calls could be optimized by adding __attribute__((const)) to fpclassify (resulted less calls, smaller code size etc) > > hm but float compare will compile to different instruction > > so there is at least performance difference > > Yes. In principle it would be faster to do everything as floating > point so no store/load delays are needed. In relality I doubt it makes > much of a difference. In almost all of these functions the actual > computation time dominates. > i see