MIPS: Implement __arch_bitrev* using bitswap for MIPSr6

Release 6 of the MIPS architecture introduced the bitswap instruction,
which reverses the bits within each byte of a word. Make use of this
instruction to implement the __arch_bitrev* functions, which should be
faster for most MIPSr6 CPUs, reduces code size slightly and allows us to
avoid the lookup table used by the generic implementation, saving 256
bytes in the kernel binary by dropping that.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13204/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Paul Burton
2016-05-06 13:35:03 +01:00
committed by Ralf Baechle
parent 015aa05f53
commit 87321fddae
2 changed files with 31 additions and 0 deletions
+1
View File
@@ -2000,6 +2000,7 @@ config CPU_MIPSR2
config CPU_MIPSR6
bool
default y if CPU_MIPS32_R6 || CPU_MIPS64_R6
select HAVE_ARCH_BITREVERSE
select MIPS_SPRAM
config EVA