Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Rafael Campana Newsgroups: scee.yaroze.programming.codewarrior Subject: Re: Optimisation Date: Mon, 25 Jan 1999 11:41:43 -0600 Organization: SCEA News Server Lines: 33 Message-ID: <36ACACD7.7EB4A46D@metrowerks.com> References: <01be3c25$1e96ac00$0a3ddec2@guildfoc> <3699C42D.E5F50301@scee.sony.co.uk> NNTP-Posting-Host: mtwks141.metrowerks.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en To: James Russell , Miles Buzzing Hi Miles, James, If an expression can be computed at compile time, it will. So in this case you will get the optimization. Thanks. Rafael Campana Metrowerks Inc. James Russell wrote: > Miles Buzzing wrote: > > > > Does anyone know how well CodeWarrior optimises constants at compile time? > > For example, if I include a #define statement such as - #define VELOCITY > > (2< > the constant ( 8192) or as a logical shift? > > Most compilers will try to calculate constants as far as they can without losing accuracy. So 1<<10 > will compile to 1024. > > Cheers, > > James > > -- > == James_Russell@scee.sony.co.uk +44 (171) 447-1626 > == Developer Support Engineer - Sony Computer Entertainment Europe > > "I TOLD you boys not to go in there. What IS your fascination with my Forbidden > Closet of Mystery?" -- Police Chief Wiggam