Use GCC builtins for byte-swapping. Fixes #10800.

* Introduced in gcc-4.3 for at least Intel platforms
* On ARM, full support added in gcc-4.8
* Other platforms untested, left as-is
* This introduces a breaking change to the ABI for gcc4