There is lot of ways to implement memcpy(), the most efficient way is of course the DMA, although it has overhead to setup the DMA descriptor. Armcc compiler just do it in a simple way
;r0 stores the destine and r1 stores the source
LDM r1!,{r3,r4,r12,lr}
STM r0!,{r3,r4,r12,lr}
Each 2 machine cycle copies 16 bytes of data. I ignored extra codes to handle non-16-bytes-aligned data.
No comments:
Post a Comment