From 2b41ce5df20b698436526fcd8478094140b91706 Mon Sep 17 00:00:00 2001 From: Vijay Kumar Date: Wed, 11 Oct 2017 12:50:05 -0600 Subject: sparc64: SPARC optimized __fls function Defined SPARC optimized __fls using lzcnt opcode. Signed-off-by: Vijay Kumar Signed-off-by: David S. Miller --- arch/sparc/lib/NG4fls.S | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/sparc/lib') diff --git a/arch/sparc/lib/NG4fls.S b/arch/sparc/lib/NG4fls.S index bc17b65f1052..2d0991e5b034 100644 --- a/arch/sparc/lib/NG4fls.S +++ b/arch/sparc/lib/NG4fls.S @@ -18,3 +18,13 @@ ENTRY(NG4fls) retl sub %g3, %g2, %o0 ENDPROC(NG4fls) + +ENTRY(__NG4fls) + brz,pn %o0, 1f + LZCNT_O0_G2 !lzcnt %o0, %g2 + mov 63, %g3 + sub %g3, %g2, %o0 +1: + retl + nop +ENDPROC(__NG4fls) -- cgit v1.2.3