From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10543 Path: news.gmane.org!.POSTED!not-for-mail From: Markus Wichmann Newsgroups: gmane.linux.lib.musl.general Subject: Re: Model specific optimizations? Date: Sat, 1 Oct 2016 10:52:14 +0200 Message-ID: <20161001085214.GE22343@voyager> References: <20160929142126.GB22343@voyager> <20160929152354.GK19318@brightrain.aerifal.cx> <20160929170801.GC22343@voyager> <20160929181336.GL19318@brightrain.aerifal.cx> <20160930045615.GD22343@voyager> <20161001055023.GA24569@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1475311980 5832 195.159.176.226 (1 Oct 2016 08:53:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Oct 2016 08:53:00 +0000 (UTC) User-Agent: Mutt/1.5.23 (2014-03-12) To: musl@lists.openwall.com Original-X-From: musl-return-10556-gllmg-musl=m.gmane.org@lists.openwall.com Sat Oct 01 10:52:56 2016 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.84_2) (envelope-from ) id 1bqG28-0006qn-Ek for gllmg-musl@m.gmane.org; Sat, 01 Oct 2016 10:52:36 +0200 Original-Received: (qmail 13938 invoked by uid 550); 1 Oct 2016 08:52:35 -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 13914 invoked from network); 1 Oct 2016 08:52:35 -0000 Content-Disposition: inline In-Reply-To: <20161001055023.GA24569@brightrain.aerifal.cx> X-Provags-ID: V03:K0:RvdEgL8TlRWpRomAE9s2Aywn0MP/BZycTY1CXl2ckmsRFMKQ4Ni t4tFvV5Chiv+IflzDZB08tgjnj9e7kZ3/kIx9BlwpvWrnMD/7gjnUVgJnCH8oH/ytHOz7A6 RaHGWftKxZlTJuERUxVzfczzjEtuEQ5x1dyfuRadeKtzu8ibWyy4sBF1LAQCLua6Xwwe3fy WCIuzutZ3Hf1mMgGe7NGw== X-UI-Out-Filterresults: notjunk:1;V01:K0:tcdXYk2KCGY=:C9l+UvzMea3XBV3aRvuFtQ K6USj0g6dHFBPsJ/ooYmUQDckdAveSiOX2j6G9p7rLSjaST+lGfgtqX1hWiTvAxbam+moUul0 ElXoys3cyAZNt/y6xn3cGigDJoi/f1p6S+l/Q5Di882Icb3NGxb6V+Z+3V5cE+lYGvF/6nq3B fksu47zRrZble5o6DkcTm2jJYmHfJkKLdTo/5kK4F81mXVzc5Gp1gqIVrj6CudDFzLY1/PqCZ Lu7HEzwDYu+ktUKqrNQIgCYrpV9EZyWgDuKkgl5l8EuwU6Edw/TPSgo/VoPF+2GLLt8mRgNcS 0MKJlPH3X29sj01WiF5R/c09YczR3pG9BesN37NgSdIVV1FrAaA+yGOaEMSLThGbCHtMTT3jY owcmfGIccvf7pk4UrCAN4vnlg/ozheMStPgxkVfJmbKlVbAIkzchJIcNhQUoSENTL06CYDcNR KG9kTln6U7bTf+E1dUzt3i3egIKVvkn7cNMqkXXfr0RLYqtFdz0Os1LPhNt0tm+yJ52vMyb4Z mJVKE/c8nhtfntJLPlV53dDnVGXpTGPeRbXFSlsToIEYtWcE/eAXgG7H/MnpDjYH4dQaaLCqs 82ALX2oJsrhwuN+Odz2d3VSPIssypSmv9gU1K7yeN11P7GlXalCemOcwjx38Kq/p1dTr7j0at CjMe/6I6TA1evIq4TGA4wArjmaAgoHl8AanwkhWcoRBbzIoZzrvw6jgdDGAWYmm7yuNU8+e8R 1gAIT/Wk4jnpXOhJJVqZvfXTsxM8Tl9seNN6aRd23yFGwDUR44585XAQaHlHmUDRGo6HwerM Xref: news.gmane.org gmane.linux.lib.musl.general:10543 Archived-At: On Sat, Oct 01, 2016 at 01:50:23AM -0400, Rich Felker wrote: > I don't think this works at all. sqrt() is required to be > correctly-rounded; that's the whole reason sqrt.c is costly. It's an approximation, at least, which was rather my point. As I've come to realize over the course of this discussion, the fsqrt instruction is useless here and pretty much everywhere out there: - If you are looking for accuracy over speed, the standard C library has got you covered. - If you are looking for speed over accuracy, you can code up the Babylonian method inside five minutes. You can even tune it to suit your needs to an extent (mainly, number of rounds and method of first approximation). This method is also portable to other architectures, and can be done entirely in C (requiring IEEE floating point, but then, most serious FP code does that). Also, at least according to Apple, which were the only ones actually looking at the thing, such as I could find, it was only ever supported by the 970 and the 970FX cores, released in 2002 and 2004, respectively. I highly doubt they'll have much relevance. Chalk up my suspicions from the OP to not having researched enough. In closing: Nice discussion, but I'm sorry for the noise. Ciao, Markus