This is the mail archive of the gcc-help@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]

Specify named registers for ARM inline asm


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" );


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