This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Specify named registers for ARM inline asm
- From: Jeremy Hall <jeremy dot m0jnx at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 30 May 2015 10:15:46 +0100
- Subject: Specify named registers for ARM inline asm
- Authentication-results: sourceware.org; auth=none
For ARM, is there a way to directly load a named register in inline asm?
Registers may be named in the clobber list, but not in the input or
output lists.
I would like to do this:
asm( "stuff" :: "r1" (xxx) );
but instead have to do this:
asm( "mov r1,%0; stuff" :: "r" (xxx) : "r1" );
Its worse for "+r"
asm( "stuff" : "+r1" (xxx) );
becomes:
asm( "mov r1,%0; stuff; mov %0,r1" : "+r" (xxx) : "r1" );