| delorie.com/archives/browse.cgi | search | 
| From: | "sl" <junk AT bbs DOT darktech DOT org> | 
| Newsgroups: | comp.os.msdos.djgpp | 
| Subject: | Re: GCC optimization | 
| Date: | Thu, 30 Dec 1999 20:09:46 -0500 (EST) | 
| Organization: | Posted via Supernews, http://www.supernews.com | 
| Lines: | 37 | 
| Message-ID: | <fyoofqnexgrpubet.fnkz8a2.pminews@nntp.generation.net> | 
| References: | <fyoofqnexgrpubet DOT fniy770 DOT pminews AT nntp DOT generation DOT net> <4VLa4.70142$X47 DOT 388252 AT quark DOT idirect DOT com> | 
| X-Complaints-To: | newsabuse AT supernews DOT com | 
| X-Newsreader: | PMINews 2.00.1205 For OS/2 | 
| MIME-Version: | 1.0 | 
| To: | djgpp AT delorie DOT com | 
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp | 
| Reply-To: | djgpp AT delorie DOT com | 
On Thu, 30 Dec 1999 16:39:28 GMT, Andrew Jones wrote:
>> Does GCC optimize "something*1024" into "something << 10"?
>
>Let's see.
>
>
>TEST.C
>~~~~
>int glob;
>
>int main(void)
>  {
>  return(glob * 1024);
>  }
>
>
>gcc -c -S test.c
>
>
>GLOB.S
>~~~~~
>[...]
>movl _glob,%eax
>movl %eax,%edx
>movl %edx,%ecx
>sall $10,%ecx
>movl %ecx,%eax
>[...]
>
>In a word: YES.
	Hehehe.. Thanks!
Gili
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |