www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1999/07/11/18:01:55

Date: Sun, 11 Jul 1999 14:58:46 -0700 (PDT)
Message-Id: <199907112158.OAA17787@southpole>
From: Colin Howell <chowell AT cygnus DOT com>
MIME-Version: 1.0
To: pgcc AT delorie DOT com
Subject: Re: libm.a
In-Reply-To: <Pine.LNX.4.10.9907111831100.32271-100000@hq.alert.sk>
References: <Pine DOT GSO DOT 4 DOT 05 DOT 9907092025470 DOT 8343-100000 AT legolas DOT mdh DOT se>
<Pine DOT LNX DOT 4 DOT 10 DOT 9907111831100 DOT 32271-100000 AT hq DOT alert DOT sk>
X-Mailer: VM 6.31 under 20.2 XEmacs Lucid
Reply-To: pgcc AT delorie DOT com
X-Mailing-List: pgcc AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Niteshadow writes:
> 
> On Fri, 9 Jul 1999, Henrik Berglund  SdU wrote:
> 
> > Have a 3dnow library that i would like to try, it has some optimised cos
> > sin sqrt funktions. 
> 
> I do not think that you can optimize these functions more than to execute
> a single instruction in the FPU.

Might be worth a try.  On modern processors, using a single
instruction to do transcendental functions may not be as optimal as
you might think.  Except for square root, such instructions are not
implemented using hard-wired circuitry.  Instead they are performed
using microcoded sequences of simpler floating-point operations.

An implementation of the functions by the compiler using sequences of
simple floating-point instructions might do better.  This would depend
on a bunch of factors, including the amount of instruction-level
parallelism available in the processor, the other floating-point
operations being performed in the same block of code, and the
effectiveness of the compiler's optimizations.

If you were using this technique, however, you'd want to make the
functions into in-line instruction sequences so that the compiler
could optimize them effectively.  If the functions are implemented
with straight library calls, most of the compiler's chances for
optimization will be lost, and the single-instruction approach will
win out.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019