From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3310 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Using float_t and double_t in math functions Date: Thu, 9 May 2013 12:02:01 -0400 Message-ID: <20130509160201.GN20323@brightrain.aerifal.cx> References: <20130509014327.GA6338@brightrain.aerifal.cx> <20130509132157.GF12689@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 1368115339 13054 80.91.229.3 (9 May 2013 16:02:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 May 2013 16:02:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3314-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 09 18:02:15 2013 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 1UaTIM-0005Lc-Hq for gllmg-musl@plane.gmane.org; Thu, 09 May 2013 18:02:14 +0200 Original-Received: (qmail 19750 invoked by uid 550); 9 May 2013 16:02:14 -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 19742 invoked from network); 9 May 2013 16:02:13 -0000 Content-Disposition: inline In-Reply-To: <20130509132157.GF12689@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3310 Archived-At: On Thu, May 09, 2013 at 03:21:57PM +0200, Szabolcs Nagy wrote: > * Rich Felker [2013-05-08 21:43:27 -0400]: > > As far as I can tell, in most of the affected code, keeping excess > > precision does not hurt the accuracy of the result, and it might even > > improve the results. Thus, nsz and I discussed (on IRC) the > > possibility of changing intermediate variables in functions that can > > accept excess precision from float and double to float_t and double_t. > > This would not affect the generated code at all on machines without > > excess precision, but on x86 (without SSE) it eliminates all the > > costly store/load pairs. As an example (on my test machine), it > > ie. it is only for i386 (without sse) > (which is not a trendy platform nowadays) > but there it improves performance and > code size a bit so it is worth doing By the way, part of the reason I think we should make the change where it doesn't hurt (and probably helps) accuracy is so we're not telling people: "Yes, some math functions in musl are slower than glibc because we're taking extra care to make sure they give you less-accurate results." :-) In practice it's very few that are slower. I think most will just go from being 2-3 times as fast as glibc to 3-5 times as fast as glibc. Rich