This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: List of possible clobber registers for x86


1.)
This small assembly routines performs an intensive calculation operation
(>25% of total app time), runs several hundred millions time... This
simply means I want to avoid any performance penalty caused by
saving/restoring the registers...
Which registers are used by GCC and should be saved/restored?

2.) Interesting approach. Could you point me to a sample code which uses
this technique?

+1: Why e.g. ECX is not belonging to GENERAL_REGS, and cannot be listed
within clobber registers?

Thanks,
Tamas


> -----Original Message-----
> From: aph@cambridge.redhat.com 
> [mailto:aph@cambridge.redhat.com] On Behalf Of Andrew Haley
> Sent: Friday, January 17, 2003 2:02 PM
> To: Tamas Nagy
> Cc: gcc@gcc.gnu.org
> Subject: List of possible clobber registers for x86
> 
> 
> Tamas Nagy writes:
>  > Dear GCC-developers,
>  > 
>  > Thanks for this great product and your efforts.  
>  > 
>  > When using inline assembly, I realized I do not know 
> exactly what registers can be listed as clobbered registers 
> in x86 platforms.  > 
>  > I have an inline assembly routines, which basicly modifies 
> the following registers  > "eax, ebx, ecx, edx, esi, edi" and 
> the memory.
> 
> Gcc isn't magical, so it needs some registers to work with.  
> You've clobbered almost all of them, so gcc can't do its job.
> 
> Two things to try:
> 
> 1.  Save and restore a couple of the registers (with push, pop) and
>     take them out of the clobber list.
> 
> 2.  Rather than using specific named registers, let gcc do register
>     allocation.  It can do a better job that way.
> 
> Andrew.
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]