This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Inline assembly constraints for a specific register
- From: Andrew Haley <aph at redhat dot com>
- To: Avi Kivity <avi at qumranet dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 6 Mar 2007 16:21:24 +0000
- Subject: Re: Inline assembly constraints for a specific register
- References: <45ED926E.9090400@qumranet.com>
Avi Kivity writes:
> How can I specify a constraint for a specific register, for example r8
> on x86_64?
>
> I can specify any of rax, rbx, rcx, and rdx using a,b, c, and d. But
> what about the rest of the register file?
Like this:
int poo (int N)
{
register int zz __asm__ ("r8") = N;
__asm__ ("mov %0, %0" : "+r"(zz));
return zz;
}
Andrew.