NG4fls.S 495 B

12345678910111213141516171819202122232425262728293031
  1. /* NG4fls.S: SPARC optimized fls and __fls for T4 and above.
  2. *
  3. * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
  4. */
  5. #include <linux/linkage.h>
  6. #define LZCNT_O0_G2 \
  7. .word 0x85b002e8
  8. .text
  9. .register %g2, #scratch
  10. .register %g3, #scratch
  11. ENTRY(NG4fls)
  12. LZCNT_O0_G2 !lzcnt %o0, %g2
  13. mov 64, %g3
  14. retl
  15. sub %g3, %g2, %o0
  16. ENDPROC(NG4fls)
  17. ENTRY(__NG4fls)
  18. brz,pn %o0, 1f
  19. LZCNT_O0_G2 !lzcnt %o0, %g2
  20. mov 63, %g3
  21. sub %g3, %g2, %o0
  22. 1:
  23. retl
  24. nop
  25. ENDPROC(__NG4fls)