Skip to content

Commit

Permalink
sparc64: SPARC optimized __fls function
Browse files Browse the repository at this point in the history
Defined SPARC optimized __fls using lzcnt opcode.

Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vijay Kumar authored and David S. Miller committed Nov 15, 2017
1 parent 70cbec0 commit 2b41ce5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/sparc/lib/NG4fls.S
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 2b41ce5

Please sign in to comment.