GNOME Bugzilla – Bug 531901
Use __builtin_bswap* for GUINT*_SWAP_LE_BE if building with GCC
Last modified: 2012-03-18 03:29:40 UTC
Hi, the attached patch makes GLib use the __builtin_bswap32 and __builtin_bswap64 GCC extensions if building with GCC. This will only be used if no architecture specific code is available yet but maybe it makes sense to also use the extension for all architectures instead of the assembly code. These extensions were added with GCC 4.3. http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Other-Builtins.html#Other-Builtins
Created attachment 110513 [details] [review] bswap.diff
I think if we decide to use builtins, we probably want to use them in preference to custom implementations.
Any news on this? Shall we use the builtins by default?
Oh, yeah. Now that we prefer builtins for atomic ops, we should do the same here.
Created attachment 161168 [details] [review] Bug 531901 - Use __builtin_bswap* for GUINT*_SWAP_LE_BE if building with GCC
Any chance we can get this pushed now?