Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / arm64 / include / asm / bitrev.h
blob6faf9fba8c65fac71de5fac87ca66b880435361e
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_BITREV_H
3 #define __ASM_BITREV_H
4 static __always_inline __attribute_const__ u32 __arch_bitrev32(u32 x)
6 __asm__ ("rbit %w0, %w1" : "=r" (x) : "r" (x));
7 return x;
10 static __always_inline __attribute_const__ u16 __arch_bitrev16(u16 x)
12 return __arch_bitrev32((u32)x) >> 16;
15 static __always_inline __attribute_const__ u8 __arch_bitrev8(u8 x)
17 return __arch_bitrev32((u32)x) >> 24;
20 #endif