EmbDev.net

Forum: ARM programming with GCC/GNU tools Explicitly naming loop labels


von Miguel Pires (Guest)


Rate this post
useful
not useful
Hello.

I was wondering if it is possible to explicitly attribute name to the 
labels that mark a loop entry.

By default, those are named something like ".L2".

What I would like is to be able to do something like

asm ("my_loop_label")
for(i=0...)

and the compilation would yield ARM assembly with that label name at the 
loop entry point.

Is something like that possible?

If not, do you happen to know a way to detect loops in ARM assembly?

Thank you.

von Johann L. (gjlayde)


Rate this post
useful
not useful
Did you check out asm goto?

http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html

This if for gcc >= 4.5 and said to be unstable...

Then, if you program GNU-C building a C-label and passing it to the 
assembler should work. However, I never tried that, look hackish, works 
for local labels only and you probably have to jump indirect.

Maybe most convenient will be to just return some value and jump 
conditionally on that instead of jumping from inside asm.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.