Commit 17fcc4bd authored by Xi Ruoyao's avatar Xi Ruoyao Committed by Huacai Chen
Browse files

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: default avatarXi Ruoyao <xry111@xry111.site>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent 10eda1c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}