Olivier Galibert <[EMAIL PROTECTED]> writes: > I need to be able to do unaligned memory accesses to memory in > big-endian or little-endian mode. For portability, I'd like to do it > in pure C, but I'd like the compiler to generate optimal sequences for > the operations.
It's probably not feasible to reliably recognize byteswapping idioms, except for 16-bit. I wrote a patch a while ago to add builtins for this (http://gcc.gnu.org/ml/gcc/2004-07/msg00470.html), but never got around to finishing it... -- Falk