LoongArch: Simplify __arch_bitrev32() implementation

LoongArch has the bitrev.w instruction to reverse bits in a 32-bit
integer, thus there's no need to reverse the bytes and use bitrev.4b.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
Xi Ruoyao
2026-02-04 16:38:20 +08:00
committed by maoxiaochuan
parent c8ae6731c5
commit 7ab68dc972
+1 -1
View File
@@ -11,7 +11,7 @@ static __always_inline __attribute_const__ u32 __arch_bitrev32(u32 x)
{
u32 ret;
asm("bitrev.4b %0, %1" : "=r"(ret) : "r"(__swab32(x)));
asm("bitrev.w %0, %1" : "=r"(ret) : "r"(x));
return ret;
}