1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __MIPS_ASM_BITREV_H__
3 #define __MIPS_ASM_BITREV_H__
5 #include <linux/swab.h>
7 static __always_inline __attribute_const__ u32
__arch_bitrev32(u32 x
)
11 asm("bitswap %0, %1" : "=r"(ret
) : "r"(__swab32(x
)));
15 static __always_inline __attribute_const__ u16
__arch_bitrev16(u16 x
)
19 asm("bitswap %0, %1" : "=r"(ret
) : "r"(__swab16(x
)));
23 static __always_inline __attribute_const__ u8
__arch_bitrev8(u8 x
)
27 asm("bitswap %0, %1" : "=r"(ret
) : "r"(x
));
31 #endif /* __MIPS_ASM_BITREV_H__ */