mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: Model specific optimizations?
Date: Sat, 1 Oct 2016 10:52:14 +0200	[thread overview]
Message-ID: <20161001085214.GE22343@voyager> (raw)
In-Reply-To: <20161001055023.GA24569@brightrain.aerifal.cx>

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


  reply	other threads:[~2016-10-01  8:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29 14:21 Markus Wichmann
2016-09-29 14:57 ` Szabolcs Nagy
2016-09-29 15:23 ` Rich Felker
2016-09-29 17:08   ` Markus Wichmann
2016-09-29 18:13     ` Rich Felker
2016-09-29 18:52       ` Adhemerval Zanella
2016-09-29 22:05         ` Szabolcs Nagy
2016-09-29 23:14           ` Adhemerval Zanella
2016-09-30  4:56       ` Markus Wichmann
2016-10-01  5:50         ` Rich Felker
2016-10-01  8:52           ` Markus Wichmann [this message]
2016-10-01 15:10             ` Rich Felker
2016-10-01 19:53               ` Markus Wichmann
2016-10-02 13:59                 ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161001085214.GE22343@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).