Adrian Bunk | b00dc83 | 2008-05-19 16:52:27 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * Sparc64 optimized strncmp code. |
| 3 | * |
| 4 | * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
| 5 | */ |
| 6 | |
David S. Miller | 8695c37 | 2012-05-11 20:33:22 -0700 | [diff] [blame] | 7 | #include <linux/linkage.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #include <asm/asi.h> |
| 9 | |
| 10 | .text |
David S. Miller | 8695c37 | 2012-05-11 20:33:22 -0700 | [diff] [blame] | 11 | ENTRY(strncmp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | brlez,pn %o2, 3f |
| 13 | lduba [%o0] (ASI_PNF), %o3 |
| 14 | 1: |
| 15 | add %o0, 1, %o0 |
| 16 | ldub [%o1], %o4 |
| 17 | brz,pn %o3, 2f |
| 18 | add %o1, 1, %o1 |
| 19 | cmp %o3, %o4 |
| 20 | bne,pn %icc, 2f |
| 21 | subcc %o2, 1, %o2 |
| 22 | bne,a,pt %xcc, 1b |
| 23 | ldub [%o0], %o3 |
| 24 | 2: |
| 25 | retl |
| 26 | sub %o3, %o4, %o0 |
| 27 | 3: |
| 28 | retl |
| 29 | clr %o0 |
David S. Miller | 8695c37 | 2012-05-11 20:33:22 -0700 | [diff] [blame] | 30 | ENDPROC(strncmp) |