linux/include/uapi
David Woodhouse cf66bb93e0 byteorder: allow arch to opt to use GCC intrinsics for byteswapping
Since GCC 4.4, there have been __builtin_bswap32() and __builtin_bswap16()
intrinsics. A __builtin_bswap16() came a little later (4.6 for PowerPC,
48 for other platforms).

By using these instead of the inline assembler that most architectures
have in their __arch_swabXX() macros, we let the compiler see what's
actually happening. The resulting code should be at least as good, and
much *better* in the cases where it can be combined with a nearby load
or store, using a load-and-byteswap or store-and-byteswap instruction
(e.g. lwbrx/stwbrx on PowerPC, movbe on Atom).

When GCC is sufficiently recent *and* the architecture opts in to using
the intrinsics by setting CONFIG_ARCH_USE_BUILTIN_BSWAP, they will be
used in preference to the __arch_swabXX() macros. An architecture which
does not set ARCH_USE_BUILTIN_BSWAP will continue to use its own
hand-crafted macros.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
2012-12-06 01:22:31 +00:00
..
asm-generic UAPI: Put a comment into uapi/asm-generic/kvm_para.h and use it from arches 2012-10-17 12:32:07 +01:00
drm UAPI: (Scripted) Disintegrate include/drm 2012-10-04 18:21:50 +01:00
linux byteorder: allow arch to opt to use GCC intrinsics for byteswapping 2012-12-06 01:22:31 +00:00
mtd UAPI: (Scripted) Disintegrate include/mtd 2012-10-09 09:49:09 +01:00
rdma UAPI: (Scripted) Set up UAPI Kbuild files 2012-10-02 18:01:35 +01:00
scsi UAPI: (Scripted) Set up UAPI Kbuild files 2012-10-02 18:01:35 +01:00
sound UAPI: (Scripted) Set up UAPI Kbuild files 2012-10-02 18:01:35 +01:00
video UAPI: (Scripted) Set up UAPI Kbuild files 2012-10-02 18:01:35 +01:00
xen UAPI: (Scripted) Disintegrate include/xen 2012-10-09 09:49:15 +01:00
Kbuild UAPI: (Scripted) Set up UAPI Kbuild files 2012-10-02 18:01:35 +01:00