]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - arch/sparc/lib/hweight.S
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/kernel/linux.git] / arch / sparc / lib / hweight.S
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
ef7c4d46 2#include <linux/linkage.h>
d3867f04 3#include <asm/export.h>
ef7c4d46
DM
4
5 .text
6 .align 32
7ENTRY(__arch_hweight8)
9289ea7f
DM
8 sethi %hi(__sw_hweight8), %g1
9 jmpl %g1 + %lo(__sw_hweight8), %g0
ef7c4d46 10 nop
ef7c4d46 11ENDPROC(__arch_hweight8)
d3867f04 12EXPORT_SYMBOL(__arch_hweight8)
ef7c4d46
DM
13 .section .popc_3insn_patch, "ax"
14 .word __arch_hweight8
15 sllx %o0, 64-8, %g1
16 retl
17 popc %g1, %o0
18 .previous
19
20ENTRY(__arch_hweight16)
9289ea7f
DM
21 sethi %hi(__sw_hweight16), %g1
22 jmpl %g1 + %lo(__sw_hweight16), %g0
ef7c4d46 23 nop
ef7c4d46 24ENDPROC(__arch_hweight16)
d3867f04 25EXPORT_SYMBOL(__arch_hweight16)
ef7c4d46
DM
26 .section .popc_3insn_patch, "ax"
27 .word __arch_hweight16
28 sllx %o0, 64-16, %g1
29 retl
30 popc %g1, %o0
31 .previous
32
33ENTRY(__arch_hweight32)
9289ea7f
DM
34 sethi %hi(__sw_hweight32), %g1
35 jmpl %g1 + %lo(__sw_hweight32), %g0
ef7c4d46 36 nop
ef7c4d46 37ENDPROC(__arch_hweight32)
d3867f04 38EXPORT_SYMBOL(__arch_hweight32)
ef7c4d46
DM
39 .section .popc_3insn_patch, "ax"
40 .word __arch_hweight32
41 sllx %o0, 64-32, %g1
42 retl
43 popc %g1, %o0
44 .previous
45
46ENTRY(__arch_hweight64)
9289ea7f
DM
47 sethi %hi(__sw_hweight16), %g1
48 jmpl %g1 + %lo(__sw_hweight16), %g0
ef7c4d46 49 nop
ef7c4d46 50ENDPROC(__arch_hweight64)
d3867f04 51EXPORT_SYMBOL(__arch_hweight64)
ef7c4d46
DM
52 .section .popc_3insn_patch, "ax"
53 .word __arch_hweight64
54 retl
55 popc %o0, %o0
56 nop
57 .previous