C optimizer

John Woods john at frog.UUCP
Thu Feb 23 14:39:00 AEST 1989


In article <9648 at smoke.BRL.MIL>, gwyn at 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 at frog.UUCP, ...!mit-eddie!jfw, jfw at 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



More information about the Comp.lang.c mailing list