Idioms for byteswapping and unaligned memory access
Falk Hueffner
falk@debian.org
Thu Apr 20 19:21:00 GMT 2006
Olivier Galibert <galibert@pobox.com> 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
More information about the Gcc
mailing list