🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #12710

Re: libm in SunOS 4.0

#12710
From: grunwald
Date: Tue, 09 May 1989 23:10
26 lines
1452 bytes
I would like to point out that with Gnu C 1.35, using the 68881 version of
math.h with inlined math functions, Gnu C produces exactly the same code
that David Hugh posted, modulo label names.

An example inline specification for Gnu C is:

__inline static const double sin (double x)
{
  double value;
  __asm ("fsin%.x %1,%0" : "=f" (value) : "f" (x));
  return value;
}

which has similar advantages to the .il template method mentioned;
however, it has further advantages, similar to the ones mentioned for
FORTRAN. Most notably, CSE and code hoisting can move the function out of
loops, although I imagine this would rarely occur for math functions.
There are other advantages of combining inline & smarter asm() notation :
you can inline other time-critical functions (e.g. spl(), spinlock loops,
etc).


--
Dirk Grunwald
Univ. of Illinois
grunwald@flute.cs.uiuc.edu
Technical Details
Message-ID: <GRUNWALD.89May3100917@flute.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request
References: <8904130100.AA14938@dgh.sun.com>

Show 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: grunwald@flute.cs.uiuc.edu
Newsgroups: comp.sys.sun
Subject: Re: libm in SunOS 4.0
Keywords: Software
Message-ID: <GRUNWALD.89May3100917@flute.cs.uiuc.edu>
Date: 9 May 89 23:10:54 GMT
References: <8904130100.AA14938@dgh.sun.com>
Sender: usenet@rice.edu
Organization: University of Illinois, Urbana-Champaign
Lines: 26
Approved: Sun-Spots@rice.edu
Original-Date: 3 May 89 15:09:17 GMT
X-Sun-Spots-Digest: Volume 7, Issue 279, message 5 of 23