]> Git Repo - linux.git/blob - arch/arm64/include/asm/bitrev.h
Merge remote-tracking branch 'spi/for-5.14' into spi-linus
[linux.git] / arch / arm64 / include / asm / bitrev.h
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)
5 {
6         __asm__ ("rbit %w0, %w1" : "=r" (x) : "r" (x));
7         return x;
8 }
9
10 static __always_inline __attribute_const__ u16 __arch_bitrev16(u16 x)
11 {
12         return __arch_bitrev32((u32)x) >> 16;
13 }
14
15 static __always_inline __attribute_const__ u8 __arch_bitrev8(u8 x)
16 {
17         return __arch_bitrev32((u32)x) >> 24;
18 }
19
20 #endif
This page took 0.032809 seconds and 4 git commands to generate.