Re:For sharing: Memory copy routine
> People might also want to look at zero-initialization routines like memset() in the same way...
Absolutely, I do this too, though I have separate routines rather than an integrated one like the copy routine.
> If your flash or SDRAM plays nicely with lines of 32 bytes...
A very good point indeed. With SDRAM burst mode length and cache lines set to match the copy routine it should really fly. Even better if the device has instruction cache too.
It will be interesting to see this on a Cortex-M3 device in the future when someone builds one with cache and an SDRAM controller.
PS: I recently noticed I push/pop r12 in my routine, in several places, this is actually not required so you can save another couple of cycles by removing it.
Post edited by: rocksoft, at: 2008/08/28 05:55
login or register to reply
|