Re: GCC inline assembler question
- From: "Raymund Hofmann" <filter002@xxxxxxxxxxxxxxxxx>
- Date: Sat, 8 Oct 2005 14:31:48 +0200
"Fred Nach" <fred_nach@xxxxxxxxxxx> schrieb im Newsbeitrag news:di0phu$qkl$1@xxxxxxxxxxxxxxxxxxxxxx
Hi all !
I'm wondering how can i use "dummy registers" inside an inline assembly part ?
I mean, considering this code :
asm("mov r1, %1, asr #15;" "teq r1, %1, asr #31;" "eorne %0, %1, %1, asr #31;" :"=r" (output) :"r" (input) :"r1" );
In this case, r1 is used only locally, and it is also clobbered, hence gcc will store its value (somewhere in the stack, memory, or other free register) before using it...
I would like to know how to let gcc determine the best register to use (for exemple if before that asm instrcution r6 is free... it leads to less store/load instructions).
Hard to explain but how can i specify to gcc that i want to use not specific register ... and let him decide the best to use ?
Thanks in advance for any help !!
Fred.
I've read some tutorial on gcc-asm dealing with this "problem". The suggestion was to "invent" additional output's - being the temporary registers - and assigning them to variables which are not used.
Raymund Hofmann
.
- References:
- GCC inline assembler question
- From: Fred Nach
- GCC inline assembler question
- Prev by Date: Re: help needed
- Next by Date: Re: help needed
- Previous by thread: Re: GCC inline assembler question
- Next by thread: ARM Privelege approach for callbacks
- Index(es):
Relevant Pages
|