usage of PLD in arm cortex a9
I a开发者_高级运维m trying to use PLD instruction. The problem I am facing is as follows:
int32_t addr[10];
asm ("PLD [addr,#5]");
I am getting following error:
Error: ARM register expected -- `pld [addr,#5]'
The address used by the preload instruction needs to be in a register. addr is a variable (memory location), not a register.
int32_t addr[10];
asm ("PLD [%[ADDR],#5] \n\t"
:
: [ADDR]"r"(addr)
);
Give the thing a name in the registers list, and then specify it like shown. 5 is a strange number to use for prefetch. Most PC will be working with sizes of 32 etc...
When using pld, the size of each line in memory is apparently 64 bytes for the arm chips in ipad and ipad2. So to pld most efficiently it would probably work best to do 1 pld for a 64 byte size range and then unroll the loop to cover just that range if that is the type of code being programmed.
For example you might move through sixteen 32 bit float sized entries for each pld.
精彩评论