After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 531901 - Use __builtin_bswap* for GUINT*_SWAP_LE_BE if building with GCC
Use __builtin_bswap* for GUINT*_SWAP_LE_BE if building with GCC
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.16.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-05-07 08:07 UTC by Sebastian Dröge (slomo)
Modified: 2012-03-18 03:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bswap.diff (876 bytes, patch)
2008-05-07 08:07 UTC, Sebastian Dröge (slomo)
none Details | Review
Bug 531901 - Use __builtin_bswap* for GUINT*_SWAP_LE_BE if building with GCC (3.72 KB, patch)
2010-05-16 13:44 UTC, Sebastian Dröge (slomo)
none Details | Review

Description Sebastian Dröge (slomo) 2008-05-07 08:07:38 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
Comment 1 Sebastian Dröge (slomo) 2008-05-07 08:07:55 UTC
Created attachment 110513 [details] [review]
bswap.diff
Comment 2 Matthias Clasen 2008-06-16 05:19:13 UTC
I think if we decide to use builtins, we probably want to use them in preference to custom implementations. 
Comment 3 Sebastian Dröge (slomo) 2010-05-10 07:56:43 UTC
Any news on this? Shall we use the builtins by default?
Comment 4 Matthias Clasen 2010-05-10 14:31:52 UTC
Oh, yeah. Now that we prefer builtins for atomic ops, we should do the same here.
Comment 5 Sebastian Dröge (slomo) 2010-05-16 13:44:18 UTC
Created attachment 161168 [details] [review]
Bug 531901 - Use __builtin_bswap* for GUINT*_SWAP_LE_BE if building with GCC
Comment 6 Sebastian Dröge (slomo) 2011-03-26 10:37:31 UTC
Any chance we can get this pushed now?