]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: bitops.h: Avoid inline asm for constant FLS
authorMaciej W. Rozycki <macro@linux-mips.org>
Fri, 3 Apr 2015 22:25:00 +0000 (23:25 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 7 Apr 2015 23:09:12 +0000 (01:09 +0200)
commit697f0c14762d9316186e6c14278f7644cfd1421c
tree2a20f707e1c7711f773e05746e5d8342bc576137
parent33c1de543b31a39b62e2a78c90fe85aa355b37d9
MIPS: bitops.h: Avoid inline asm for constant FLS

GCC is smart enough to substitute the final result for FLS calculations
as implemented in the fallback C code we have in `__fls' and `fls'
applied to constant values.  The presence of inline asm defeats the
compiler though, forcing it to emit extraneous CLZ/DCLZ calculation for
processors that support these instructions.

Use `__builtin_constant_p' then to avoid inline asm altogether for
constants.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9681/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/bitops.h