Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!bcm!dimacs.rutgers.edu!rutgers!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!spot From: spot@CS.CMU.EDU (Scott Draves) Newsgroups: comp.arch Subject: Re: bizarre instructions Message-ID: Date: 26 Feb 91 19:33:51 GMT References: <9102220245.AA14853@ucbvax.Berkeley.EDU> <1991Feb25.134714.23523@linus.mitre.org> <10244@dog.ee.lbl.gov> <1991Feb25.203629.5059@linus.mitre.org> <10278@dog.ee.lbl.gov> <61756@masscomp.westford.ccur.com> <1991Feb26.155558.4215@watdragon.waterloo.edu> Sender: netnews@cs.cmu.edu (USENET News Group Software) Organization: School of Computer Science, Carnegie Mellon University Lines: 25 In-Reply-To: ccplumb@rose.uwaterloo.ca's message of 26 Feb 91 15:55:58 GMT In article <1991Feb26.155558.4215@watdragon.waterloo.edu> ccplumb@rose.uwaterloo.ca (Colin Plumb) writes: > 3. Special-case optimizations are performed: > A**0.5 -> SQRT(A) > A**1.0 -> A Not done by the above. I can see how the A**0.5 is useful; I can't see how A**1.0 is - do programmers often write this? probably just about never. but that doesn't mean the compiler shouldn't deal with it. A lot of code is generated by cpp (or lisp macros), and therefore contains all sorts of stupidity. this is an important point to keep in mind. as an example, suppose I wrote the cpp macro #define GammaCorrect(intensity, gamma) \ (pow((double)(intensity),1.0/(double)(gamma))) A perfectly sane programmer might write GammaCorrect(i, 1.0). -- IBM Scott Draves Intel spot@cs.cmu.edu Microsoft Brought to you by Super Global Mega Corp .com