🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #12505

Re: Fortran 300 times faster than C for computing cosine

#12505
From: steinmetz!dawn!stpeters
Date: Sat, 06 May 1989 00:37
26 lines
1445 bytes
In article <8903221250.AA03853@trantor.harris-atd.com> you write:
>Does anyone know of an optimizer which will convert calls to the standard
>math routines to their 68881 instruction counterparts?

In effect, yes.  The mechanism Sun uses is to have in-line code (.il)
templates that cause the compiler to generate in-line code in place of the
math library calls.

If you're running SunOS 3.X:

	cc -c -f68881 program.c /usr/lib/f68881.il
	cc -o program -f68881 program.o -lm

If you're running 4.0, it's even easier:

	cc -o program program.c /usr/lib/f68881/libm.il

Substitute soft, switch, or fpa for f68881 as appropriate.

These can make differences of HUGE factors in how fast floating point
programs run.  That floating point manual really is worth reading :-)

Dick St.Peters
GE Corporate R&D, Schenectady, NY
stpeters@dawn.crd.ge.com
uunet!steinmetz!dawn!stpeters
Technical Details
Message-ID: <8904192130.AA08387@dawn.steinmetz.Ge.Com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!husc6!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!husc6!rice!sun-spots-request
From: steinmetz!dawn!stpeters@uunet.uu.net
Newsgroups: comp.sys.sun
Subject: Re: Fortran 300 times faster than C for computing cosine
Keywords: Software
Message-ID: <8904192130.AA08387@dawn.steinmetz.Ge.Com>
Date: 6 May 89 00:37:34 GMT
Sender: usenet@rice.edu
Organization: GE Corporate R&D, Schenectady, NY
Lines: 26
Approved: Sun-Spots@rice.edu
Original-Date: Wed, 19 Apr 89 17:30:00 EDT
X-Sun-Spots-Digest: Volume 7, Issue 269, message 2 of 23