single ARM instruction to copy C into r0 ?

Feb 14, 2007 23 Replies

Correct, this is the standard assumption of C/C++, eg. int arr[100] implies that &arr[100] != NULL. Many compilers and in particular loop optimizers use stronger assumptions than that to allow prefetching and other advanced loop transformations. All this is considered safe, especially since the first and last 4KB are typically reserved by the OS.

Yes, architecture 5 made interworking much simpler so you don't need veneers or special return sequences anymore.

Yes, this is good for codesize. Good compilers even use STM to create a small amount of stack:

PUSH {r0-r2, r4, lr} ; push r4, lr and create 12 bytes of stack space ... POP {r1-r3, r4, pc} ; remove 12 bytes of stack, restore r4,lr and return r0

High-end ARMs typically transfer 2 registers per cycle and may execute other instructions in parallel, so it doesn't cost much performance.

Yes... No there is no relation, but I dislike goto's as well!

Wilco

= 0

[snip]

Errm, am I missing something - you mentioned ARM922T, which is ARM9TDMI core and according to the manual it's ARM Architecture v4T. Or are you just talking about a different target you're working on?

[snip]

:-))

C = 0

Thanks tum_ for pointing that self-contradiction. Indeed my current target uses an ARM922T core, I can't figure out why I assumed architecture version 5, and it looks like POP {pc} will not return to Thumb mode if needed :-(

Francois Grieu

X, C = 0

arithmetic)

pointer

And thanks to Wilco Dijkstra for mentioning the 'new UAL syntax', I've never heard about it before and learned something new. DUI 0204F (from the ARM site) explains things quite well. (Unfortunately, I don't have the luxury of choosing development tools, I'm stuck with gcc).

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required