On Tue, 2007-01-16 at 20:04 -0800, Michael Eager wrote: > But unaligned char arrays make strcpy much slower.
Actually it depends on the processor unless you are messed up by using -mstrict-align which is a huge hammer for most (if not all) PowerPC processors even though the few cases which need an unaligned exception handler is small. For an example of the Cell, all GP register access is optimal unless it crosses a 32byte boundary and then it is microcoded into the next smaller unit. For double and float, the access only needs word aligned to be optimal but otherwise it calls an unaligned exception handler. I forget how the string instructions are done but I think those are microcoded also, likewise with the multiple stores/loads. Most if not all PowerPC are this way, I think even the ISA requires this (except if instead of going access a 32byte boundary, it is a different boundary (the page boundary) and that would then call the unaligned exception handler and that is rarer). Who really need to start getting the PS3 game OS to do an unaligned exception handler that works instead of hanging. Thanks, Andrew Pinski