[Bug 2803] New: uClibc should use __builtin_bswap{32, 64} on at least some archs
bugzilla at busybox.net
bugzilla at busybox.net
Sat Nov 13 20:18:34 UTC 2010
https://bugs.busybox.net/show_bug.cgi?id=2803
Summary: uClibc should use __builtin_bswap{32,64} on at least
some archs
Product: uClibc
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P5
Component: Other
AssignedTo: unassigned at uclibc.org
ReportedBy: peter at pcc.me.uk
CC: uclibc-cvs at uclibc.org
Estimated Hours: 0.0
Created attachment 2665
--> https://bugs.busybox.net/attachment.cgi?id=2665
[PATCH] byteswap: use compiler builtins if available
GCC has provided the builtins __builtin_bswap32 and __builtin_bswap64 since
4.2. If we have a sufficient GCC version, we should use the builtins instead
of our own implementation. This allows the compiler to apply optimisations
(e.g. bswap(bswap(x)) = x).
Attached is a patch which should act as a starting point.
One issue to be decided: on which architectures should we use the builtin? The
patch uses the builtin on all architectures, but looking through the gcc source
code it appears that the set of optimised bswap implementations overlaps but
differs between gcc and uClibc. gcc covers all the major architectures though,
so this may not be such a crucial point.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the uClibc-cvs
mailing list