Date: Thu, 13 Nov 1997 22:37:38 -0800 (PST) Message-Id: <199711140637.WAA20704@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Paul Shirley , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Disabling use of registers Precedence: bulk At 02:28 11/10/1997 +0000, Paul Shirley wrote: >In article , Carolyn Kelly-Pajot > writes >>Is there a way of making GCC not use a certain register? I'm trying to use some >>registers to speed up code, and want to make sure they are not used by the rest >>of my code. >> >> >Have a look at info /gcc/C extensions/Explicit reg vars/Global reg >vars/. > >I believe GForth uses global registers for a large speedup, in most >normal code its hard to think of a case where it would be useful on >intel cpu's. It does, if you enable it with the right switch to `configure'. Yeah, explicit register variables are most useful for simple interpreters (like Forth) and machine emulators. Otherwise, think twice. > I assume you know what you're doing but don't forget to >check wether the code actually runs faster: you could easily lose more >performance from register starvation than you gain. > >Don't allocate eax, I'm not sure which other registers are preserved >across library calls. eax, ecx and edx are clobbered by function calls, all others are preserved. HTH Nate Eldredge eldredge AT ap DOT net