comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Quick inverse square root
Date: Thu, 7 Jan 2021 17:49:32 -0000 (UTC)	[thread overview]
Message-ID: <rt7hjc$a5d$2@dont-email.me> (raw)
In-Reply-To: 6489a95e-dae1-486e-9aee-78e9d6e50ecan@googlegroups.com

On Mon, 04 Jan 2021 12:55:33 -0800, Matt Borchers wrote:

> As computers get faster, storage gets larger, and code libraries get
> bigger, it is unfortunate that most programmers do not need to be as
> clever as they once were required to be.
> 
> Thanks for finding and sharing the PDF paper!  I'm amazed someone could
> write so many pages on this.  Out of curiosity, I need to compare my
> computed magic number with theirs from their 64-bit float example.

Having spent quite some time elsewhere getting sqrt down to a single 
clock cycle (throughput : 8 cycle latency) it doesn't surprise me at all. 
(The name Terje Mathisen comes to mind for assembly language 
implementations)

The odd coding (non use of union, strange use of intermediate variables) 
may well have been the result of compiler code generation limitations; 
the "better" form may have compiled to a few more instructions or run a 
little more slowly; not a good thing for a gamer on limited hardware!

Have you benchmarked the pretty Ada version against the original C ... or 
against a straightforward float operation on modern hardware?

-- Brian

      parent reply	other threads:[~2021-01-07 17:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02 22:26 Quick inverse square root Matt Borchers
2021-01-02 23:18 ` Jeffrey R. Carter
2021-01-03 10:58 ` Dmitry A. Kazakov
2021-01-03 22:31   ` Matt Borchers
2021-01-03 23:47     ` Jeffrey R. Carter
2021-01-04  3:50       ` Matt Borchers
2021-01-04  4:28         ` Matt Borchers
2021-01-04 11:04         ` Jeffrey R. Carter
2021-01-04 11:13     ` AdaMagica
2021-01-04 11:28       ` AdaMagica
2021-01-04 12:13         ` Dmitry A. Kazakov
2021-01-04 13:39 ` Egil H H
2021-01-04 20:55   ` Matt Borchers
2021-01-04 21:06     ` Paul Rubin
2021-01-05  2:22       ` Matt Borchers
2021-01-07 17:49     ` Brian Drummond [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox