Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!apple!bbn!mit-eddie!ll-xn!adelie!mirror!frog!john From: john@frog.UUCP (John Woods) Newsgroups: comp.lang.c Subject: Re: C optimizer Keywords: C pure function optimization Message-ID: <1026@frog.UUCP> Date: 23 Feb 89 04:39:00 GMT References: <515@larry.UUCP> <9648@smoke.BRL.MIL> Organization: Misanthropes-R-Us Lines: 18 In article <9648@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: > Note also that ANSI C implementations can > #define cos(x) __intrinsic_cos(x) > or something along those lines, to allow the compiler to generate > in-line code rather than an actual function call for standard > functions. There actually is floating-point hardware with SQRT > support; I don't know about COS. The 68881 chip has FCOS, FSIN, and (gasp) FSINCOS which simultaneously computes cos() and sin() of the same argument. A sufficiently clever compiler could potentially make great use of that. -- John Woods, Charles River Data Systems, Framingham MA, (508) 626-1101 ...!decvax!frog!john, john@frog.UUCP, ...!mit-eddie!jfw, jfw@eddie.mit.edu "He should be put in stocks in Lafeyette Square across from the White House and pelted with dead cats." - George F. Will