memcmp.S 524 B

123456789101112131415161718192021222324252627282930
  1. /* Sparc optimized memcmp code.
  2. *
  3. * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  4. * Copyright (C) 2000, 2008 David S. Miller (davem@davemloft.net)
  5. */
  6. #include <linux/linkage.h>
  7. #include <asm/asm.h>
  8. #include <asm/export.h>
  9. .text
  10. ENTRY(memcmp)
  11. cmp %o2, 0
  12. 1: BRANCH32(be, pn, 2f)
  13. nop
  14. ldub [%o0], %g7
  15. ldub [%o1], %g3
  16. sub %o2, 1, %o2
  17. add %o0, 1, %o0
  18. add %o1, 1, %o1
  19. subcc %g7, %g3, %g3
  20. BRANCH32(be, pt, 1b)
  21. cmp %o2, 0
  22. retl
  23. mov %g3, %o0
  24. 2: retl
  25. mov 0, %o0
  26. ENDPROC(memcmp)
  27. EXPORT_SYMBOL(memcmp)