hweight.S 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include <linux/linkage.h>
  2. #include <asm/export.h>
  3. .text
  4. .align 32
  5. ENTRY(__arch_hweight8)
  6. ba,pt %xcc, __sw_hweight8
  7. nop
  8. nop
  9. ENDPROC(__arch_hweight8)
  10. EXPORT_SYMBOL(__arch_hweight8)
  11. .section .popc_3insn_patch, "ax"
  12. .word __arch_hweight8
  13. sllx %o0, 64-8, %g1
  14. retl
  15. popc %g1, %o0
  16. .previous
  17. ENTRY(__arch_hweight16)
  18. ba,pt %xcc, __sw_hweight16
  19. nop
  20. nop
  21. ENDPROC(__arch_hweight16)
  22. EXPORT_SYMBOL(__arch_hweight16)
  23. .section .popc_3insn_patch, "ax"
  24. .word __arch_hweight16
  25. sllx %o0, 64-16, %g1
  26. retl
  27. popc %g1, %o0
  28. .previous
  29. ENTRY(__arch_hweight32)
  30. ba,pt %xcc, __sw_hweight32
  31. nop
  32. nop
  33. ENDPROC(__arch_hweight32)
  34. EXPORT_SYMBOL(__arch_hweight32)
  35. .section .popc_3insn_patch, "ax"
  36. .word __arch_hweight32
  37. sllx %o0, 64-32, %g1
  38. retl
  39. popc %g1, %o0
  40. .previous
  41. ENTRY(__arch_hweight64)
  42. ba,pt %xcc, __sw_hweight64
  43. nop
  44. nop
  45. ENDPROC(__arch_hweight64)
  46. EXPORT_SYMBOL(__arch_hweight64)
  47. .section .popc_3insn_patch, "ax"
  48. .word __arch_hweight64
  49. retl
  50. popc %o0, %o0
  51. nop
  52. .previous