Skip to content

Commit 17fcc4b

Browse files
xry111chenhuacai
authored andcommitted
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>
1 parent 10eda1c commit 17fcc4b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/loongarch/include/asm/bitrev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static __always_inline __attribute_const__ u32 __arch_bitrev32(u32 x)
1111
{
1212
u32 ret;
1313

14-
asm("bitrev.4b %0, %1" : "=r"(ret) : "r"(__swab32(x)));
14+
asm("bitrev.w %0, %1" : "=r"(ret) : "r"(x));
1515
return ret;
1616
}
1717

0 commit comments

Comments
 (0)