s390: use generic uapi/asm/swab.h
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 2 Aug 2017 07:45:02 +0000 (09:45 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 3 Aug 2017 11:16:27 +0000 (13:16 +0200)
commit3cb8f11c5d3ad853ce71cee3cad753cf81376fd8
tree4db8ff0ed405868feb5f3a6a481e484c0217c04e
parent2edf3fa5766f5aa1715a612d31bbd15b2211d64e
s390: use generic uapi/asm/swab.h

clang doesn't like s390 specific inline assembler constraints. These
are present in our arch specific uapi/asm/swab.h which again is
required by some ebpf test cases.

For current compiler versions the generic swab.h already makes use of
gcc's builtin functions. Therefore we can simply remove our own header
file and use the generic one.

This will generate worse code if used with compilers before gcc 4.8,
which has no __builtin_bswap16(); or before gcc v4.4, which has no
__builtin_bswap[32|64](). For these cases a C implementation fallback
would be used which generates more code, but is still correct (170KB
extra code for gcc 4.3 with performance_defconfig).

However given that we need (and want) to get rid of the inline
assemblies anyway in order to be able to use clang, the above is just
a minor drawback if old gcc compilers are used.

With current compilers there is close to zero difference, except for
three btrfs bit functions which generate more out-of-line code. The
generated code looks still correct and also uses the s390 specific
byteswap instructions.

Reported-and-tested-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/uapi/asm/Kbuild
arch/s390/include/uapi/asm/swab.h [deleted file]