alphalinux.org high-perf list (1998-2001)
 help / color / mirror / Atom feed
* Re: sqrt
@ 1999-02-22  9:03 Robert Harley
  1999-02-22 10:39 ` sqrt Joachim Wesner
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Harley @ 1999-02-22  9:03 UTC (permalink / raw)


I wrote:

>We have a problem with sqrt on Alpha Linux.

Joachim replied:

>Ehmmm, if last bit accuracy is your problem [...]

Well actually, no it isn't *my* problem in particular.

If somebody has a program running slowly because of sqrt's and they

realise what the problem is and they know about libffm or some other

replacement, then they can speed up that program if they feel that the

effort is worthwhile.

But if we replace the libm sqrt() with one that is ten times faster,

then all programs that use sqrt's will go faster for everybody,

transparently.  This is desireable, IMO!

Rob.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: sqrt
@ 1999-02-21 23:10 Joachim Wesner
  0 siblings, 0 replies; 6+ messages in thread
From: Joachim Wesner @ 1999-02-21 23:10 UTC (permalink / raw)


Robert Harley wrote:

> 

> We have a problem with sqrt on Alpha Linux.

> 

>

>   3. The fast one by Wesner & Goto doesn't get the last bit correct.

> 

> Ideally we should have one that's correct (well duh), fast, and gets

> the last bit right (as required by the IEEE standard, so we can

> replace the default one in libm).  Then most people will be happy and

> those who want to lose last bit accuracy in exchange for the extra bit

> of speed can still do so.

> 

Ehmmm, if last bit accuracy is your problem, the current libffm sqrt can

be changed back to correctly round ! It's only few instructions I edited

out from the Mosberger .S source just due to the reasons you give above

(squuze out max. speed). Goto's improvement will still apply and you

will get < 100 clocks !!

Give me a day or so to change and test (just busy with something else)

Joachim

^ permalink raw reply	[flat|nested] 6+ messages in thread
* sqrt
@ 1999-02-21 16:02 Robert Harley
  1999-02-27  8:46 ` sqrt Kazushige Goto
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Harley @ 1999-02-21 16:02 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]

We have a problem with sqrt on Alpha Linux.

  1. The original square root gave bogus answers for very small inputs.

  2. The current one is ten times too slow.

  3. The fast one by Wesner & Goto doesn't get the last bit correct.

Ideally we should have one that's correct (well duh), fast, and gets

the last bit right (as required by the IEEE standard, so we can

replace the default one in libm).  Then most people will be happy and

those who want to lose last bit accuracy in exchange for the extra bit

of speed can still do so.

Anyway we should grab this particular bull by the horns, IMHO.

In the next messages I'll send a C implementation (using 64-bit longs)

and an ASM one (for Alpha of course).

I left out the code to handle negative inputs, NaNs and so on for now

to avoid getting distracted by them.

What I'm hoping is that some of you will see ways to simplify and/or

speed up the code.  I've tried tuning the ASM a bit, but I don't

understand the 21164's scheduling well.  For instance there's one

place I have a FNOP and putting a UNOP costs five extra cycles.  I've

no idea why!

The total time seems to be 101 or 103 cycles or thereabouts.  Anyone

want to knock of a few cycles to get under the 100 barrier?

Rob.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-02-28  5:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-02-22  9:03 sqrt Robert Harley
1999-02-22 10:39 ` sqrt Joachim Wesner
  -- strict thread matches above, loose matches on Subject: below --
1999-02-21 23:10 sqrt Joachim Wesner
1999-02-21 16:02 sqrt Robert Harley
1999-02-27  8:46 ` sqrt Kazushige Goto
1999-02-28  5:14   ` sqrt Kazushige Goto

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