delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/14/01:39:01

Date: Thu, 13 Nov 1997 22:37:38 -0800 (PST)
Message-Id: <199711140637.WAA20704@adit.ap.net>
Mime-Version: 1.0
To: Paul Shirley <Paul AT chocolat DOT obvious DOT fake DOT foobar DOT co DOT uk>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Disabling use of registers

At 02:28  11/10/1997 +0000, Paul Shirley wrote:
>In article <O6EQDcF78GA DOT 198 AT upnetnews03>, Carolyn Kelly-Pajot
><dehacked72 AT hotmail DOT com> 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



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019