Article View: comp.sys.sun
Article #12507Re: Fortran 300 times faster than C for computing cosine
From: Joerg Schilling
Date: Sat, 06 May 1989 01:01
Date: Sat, 06 May 1989 01:01
55 lines
1734 bytes
1734 bytes
The sun C compiles does convert calls to the *external* c function sin() ...
into 68881 routines if you tell him to use the inline expander.
Try the folling c program (t.c):
extern double sin();
double t()
{
return sin(123.0);
}
use the command :
joerg > cc -v -O2 -f68881 -S /usr/lib/f68881/libm.il t.c
..
Verbose output removed.
joerg > cat t.s
..
Several lines removed.
.text
.globl _t
_t:
|#PROLOGUE# 0
link a6,#-8
|#PROLOGUE# 1
movl L2000000+4,sp@-
movl L2000000,sp@-
fsind sp@,fp0
fmoved fp0,sp@
movl sp@+,a6@(-8)
movl sp@+,a6@(-4)
movl a6@(-8),d0
movl a6@(-4),d1
|#PROLOGUE# 2
unlk a6
|#PROLOGUE# 3
rts
L2000000:
.long 1079951360,0
joerg >
As you see the call to the *external* function is converted into the
correct mc68881 code. See the manual of inline(1) for more information.
J. Schilling
H. Berthold AG
Teltowkanalstr. 1-4
D 1000 Berlin 46
+49 30 7795 - 400
joerg@berthold.de
.. tub!berthold!joerg
.. unido!berthold!joerg
Technical Details
Message-ID:
<8904211453.AA05501@MINNI.>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: joerg%berthold.UUCP%TUB.BITNET@mitvma.mit.edu (Joerg Schilling) Newsgroups: comp.sys.sun Subject: Re: Fortran 300 times faster than C for computing cosine Keywords: Software Message-ID: <8904211453.AA05501@MINNI.> Date: 6 May 89 01:01:54 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 55 Approved: Sun-Spots@rice.edu Original-Date: Fri, 21 Apr 89 16:53:17 +0200 X-Sun-Spots-Digest: Volume 7, Issue 269, message 4 of 23