mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
This single patch is effectively a no-op for now. It enables architectures
to opt in to using GCC's __builtin_bswapXX() intrinsics for byteswapping, and if we merge this now then the architecture maintainers can enable it for their arch during the next cycle without dependency issues. It's worth making it a par-arch opt-in, because although in *theory* the compiler should never do worse than hand-coded assembler (and of course it also ought to do a lot better on platforms like Atom and PowerPC which have load-and-swap or store-and-swap instructions), that isn't always the case. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46453 for example. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlDRvNsACgkQdwG7hYl686O7KACeKQMiuZMLB9ctF5u0Iql+33PF +WAAnisvZ8HCUjG5E8DF6HWy45r4BjUp =eeUs -----END PGP SIGNATURE----- Merge tag 'byteswap-for-linus-20121219' of git://git.infradead.org/users/dwmw2/byteswap Pull preparatory gcc intrisics bswap patch from David Woodhouse: "This single patch is effectively a no-op for now. It enables architectures to opt in to using GCC's __builtin_bswapXX() intrinsics for byteswapping, and if we merge this now then the architecture maintainers can enable it for their arch during the next cycle without dependency issues. It's worth making it a par-arch opt-in, because although in *theory* the compiler should never do worse than hand-coded assembler (and of course it also ought to do a lot better on platforms like Atom and PowerPC which have load-and-swap or store-and-swap instructions), that isn't always the case. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46453 for example." * tag 'byteswap-for-linus-20121219' of git://git.infradead.org/users/dwmw2/byteswap: byteorder: allow arch to opt to use GCC intrinsics for byteswapping
This commit is contained in:
commit
7f2de8171d
4 changed files with 45 additions and 3 deletions
19
arch/Kconfig
19
arch/Kconfig
|
|
@ -113,6 +113,25 @@ config HAVE_EFFICIENT_UNALIGNED_ACCESS
|
|||
See Documentation/unaligned-memory-access.txt for more
|
||||
information on the topic of unaligned memory accesses.
|
||||
|
||||
config ARCH_USE_BUILTIN_BSWAP
|
||||
bool
|
||||
help
|
||||
Modern versions of GCC (since 4.4) have builtin functions
|
||||
for handling byte-swapping. Using these, instead of the old
|
||||
inline assembler that the architecture code provides in the
|
||||
__arch_bswapXX() macros, allows the compiler to see what's
|
||||
happening and offers more opportunity for optimisation. In
|
||||
particular, the compiler will be able to combine the byteswap
|
||||
with a nearby load or store and use load-and-swap or
|
||||
store-and-swap instructions if the architecture has them. It
|
||||
should almost *never* result in code which is worse than the
|
||||
hand-coded assembler in <asm/swab.h>. But just in case it
|
||||
does, the use of the builtins is optional.
|
||||
|
||||
Any architecture with load-and-swap or store-and-swap
|
||||
instructions should set this. And it shouldn't hurt to set it
|
||||
on architectures that don't have such instructions.
|
||||
|
||||
config HAVE_SYSCALL_WRAPPERS
|
||||
bool
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue