diff options
author | David S. Miller <davem@davemloft.net> | 2011-07-29 09:42:07 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-02 21:28:50 -0700 |
commit | ef7c4d4675d2a9206f913f26ca1a5cd41bff9d41 (patch) | |
tree | 88839b80e603ba395882df98b8a8c8f8385337b1 /arch/sparc/lib/hweight.S | |
parent | e95ade083939dcb4b0c51c1a2c8504ea9ef3d6ef (diff) | |
download | blackbird-op-linux-ef7c4d4675d2a9206f913f26ca1a5cd41bff9d41.tar.gz blackbird-op-linux-ef7c4d4675d2a9206f913f26ca1a5cd41bff9d41.zip |
sparc: Use popc if possible for hweight routines.
Just like powerpc, we code patch at boot time.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/lib/hweight.S')
-rw-r--r-- | arch/sparc/lib/hweight.S | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/sparc/lib/hweight.S b/arch/sparc/lib/hweight.S new file mode 100644 index 000000000000..95414e0a6808 --- /dev/null +++ b/arch/sparc/lib/hweight.S @@ -0,0 +1,51 @@ +#include <linux/linkage.h> + + .text + .align 32 +ENTRY(__arch_hweight8) + ba,pt %xcc, __sw_hweight8 + nop + nop +ENDPROC(__arch_hweight8) + .section .popc_3insn_patch, "ax" + .word __arch_hweight8 + sllx %o0, 64-8, %g1 + retl + popc %g1, %o0 + .previous + +ENTRY(__arch_hweight16) + ba,pt %xcc, __sw_hweight16 + nop + nop +ENDPROC(__arch_hweight16) + .section .popc_3insn_patch, "ax" + .word __arch_hweight16 + sllx %o0, 64-16, %g1 + retl + popc %g1, %o0 + .previous + +ENTRY(__arch_hweight32) + ba,pt %xcc, __sw_hweight32 + nop + nop +ENDPROC(__arch_hweight32) + .section .popc_3insn_patch, "ax" + .word __arch_hweight32 + sllx %o0, 64-32, %g1 + retl + popc %g1, %o0 + .previous + +ENTRY(__arch_hweight64) + ba,pt %xcc, __sw_hweight64 + nop + nop +ENDPROC(__arch_hweight64) + .section .popc_3insn_patch, "ax" + .word __arch_hweight64 + retl + popc %o0, %o0 + nop + .previous |