[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251105151257.148530-3-xry111@xry111.site>
Date: Wed, 5 Nov 2025 23:12:54 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>
Cc: Mingcong Bai <jeffbai@...c.io>,
Xi Ruoyao <xry111@...111.site>,
loongarch@...ts.linux.dev (open list:LOONGARCH),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 2/2] 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@...111.site>
---
arch/loongarch/include/asm/bitrev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/include/asm/bitrev.h b/arch/loongarch/include/asm/bitrev.h
index 46f275b9cdf7..757738ea38d7 100644
--- a/arch/loongarch/include/asm/bitrev.h
+++ b/arch/loongarch/include/asm/bitrev.h
@@ -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;
}
--
2.51.2
Powered by blists - more mailing lists