------- Comment #6 from pinskia at gcc dot gnu dot org 2008-09-17 19:06 ------- You can also use __builtin_bswap32 in GCC 4.3 and above which gives you the best code generation as it understands loading from memory and if the value is in a register already.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37562