summaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorVijay Kumar <vijay.ac.kumar@oracle.com>2017-10-11 12:50:05 -0600
committerDavid S. Miller <davem@davemloft.net>2017-11-15 14:26:46 +0900
commit2b41ce5df20b698436526fcd8478094140b91706 (patch)
treef582e33569b181aaa96280339866d80327b2d9f6 /arch/sparc
parent70cbec0c53739e170ea9c418e740f007ab5bca52 (diff)
downloadlinux-stable-2b41ce5df20b698436526fcd8478094140b91706.tar.gz
linux-stable-2b41ce5df20b698436526fcd8478094140b91706.tar.bz2
linux-stable-2b41ce5df20b698436526fcd8478094140b91706.zip
sparc64: SPARC optimized __fls function
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>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/lib/NG4fls.S10
1 files changed, 10 insertions, 0 deletions
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)