1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 3 * Copyright (C) 2020-2022 Loongson Technology 4 */ 5 #ifndef __LOONGARCH_ASM_BITREV_H__ 6 #define __LOONGARCH_ASM_BITREV_H__ 7 8 #include <linux/swab.h> 9 10 static __always_inline __attribute_const__ u32 11 { 12 u32 ret; 13 14 asm("bitrev.4b %0, %1" : "=r"(ret) : 15 return ret; 16 } 17 18 static __always_inline __attribute_const__ u16 19 { 20 u16 ret; 21 22 asm("bitrev.4b %0, %1" : "=r"(ret) : 23 return ret; 24 } 25 26 static __always_inline __attribute_const__ u8 27 { 28 u8 ret; 29 30 asm("bitrev.4b %0, %1" : "=r"(ret) : 31 return ret; 32 } 33 34 #endif /* __LOONGARCH_ASM_BITREV_H__ */ 35
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.