diff options
Diffstat (limited to 'arch/powerpc/lib/string.S')
-rw-r--r-- | arch/powerpc/lib/string.S | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/powerpc/lib/string.S b/arch/powerpc/lib/string.S index 64e2e499e32a..455881a5563f 100644 --- a/arch/powerpc/lib/string.S +++ b/arch/powerpc/lib/string.S | |||
@@ -28,7 +28,7 @@ _GLOBAL(strcpy) | |||
28 | /* This clears out any unused part of the destination buffer, | 28 | /* This clears out any unused part of the destination buffer, |
29 | just as the libc version does. -- paulus */ | 29 | just as the libc version does. -- paulus */ |
30 | _GLOBAL(strncpy) | 30 | _GLOBAL(strncpy) |
31 | cmpwi 0,r5,0 | 31 | PPC_LCMPI 0,r5,0 |
32 | beqlr | 32 | beqlr |
33 | mtctr r5 | 33 | mtctr r5 |
34 | addi r6,r3,-1 | 34 | addi r6,r3,-1 |
@@ -39,7 +39,7 @@ _GLOBAL(strncpy) | |||
39 | bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */ | 39 | bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */ |
40 | bnelr /* if we didn't hit a null char, we're done */ | 40 | bnelr /* if we didn't hit a null char, we're done */ |
41 | mfctr r5 | 41 | mfctr r5 |
42 | cmpwi 0,r5,0 /* any space left in destination buffer? */ | 42 | PPC_LCMPI 0,r5,0 /* any space left in destination buffer? */ |
43 | beqlr /* we know r0 == 0 here */ | 43 | beqlr /* we know r0 == 0 here */ |
44 | 2: stbu r0,1(r6) /* clear it out if so */ | 44 | 2: stbu r0,1(r6) /* clear it out if so */ |
45 | bdnz 2b | 45 | bdnz 2b |
@@ -70,8 +70,8 @@ _GLOBAL(strcmp) | |||
70 | blr | 70 | blr |
71 | 71 | ||
72 | _GLOBAL(strncmp) | 72 | _GLOBAL(strncmp) |
73 | PPC_LCMPI r5,0 | 73 | PPC_LCMPI 0,r5,0 |
74 | beqlr | 74 | beq- 2f |
75 | mtctr r5 | 75 | mtctr r5 |
76 | addi r5,r3,-1 | 76 | addi r5,r3,-1 |
77 | addi r4,r4,-1 | 77 | addi r4,r4,-1 |
@@ -82,6 +82,8 @@ _GLOBAL(strncmp) | |||
82 | beqlr 1 | 82 | beqlr 1 |
83 | bdnzt eq,1b | 83 | bdnzt eq,1b |
84 | blr | 84 | blr |
85 | 2: li r3,0 | ||
86 | blr | ||
85 | 87 | ||
86 | _GLOBAL(strlen) | 88 | _GLOBAL(strlen) |
87 | addi r4,r3,-1 | 89 | addi r4,r3,-1 |
@@ -92,8 +94,8 @@ _GLOBAL(strlen) | |||
92 | blr | 94 | blr |
93 | 95 | ||
94 | _GLOBAL(memcmp) | 96 | _GLOBAL(memcmp) |
95 | cmpwi 0,r5,0 | 97 | PPC_LCMPI 0,r5,0 |
96 | ble- 2f | 98 | beq- 2f |
97 | mtctr r5 | 99 | mtctr r5 |
98 | addi r6,r3,-1 | 100 | addi r6,r3,-1 |
99 | addi r4,r4,-1 | 101 | addi r4,r4,-1 |
@@ -106,8 +108,8 @@ _GLOBAL(memcmp) | |||
106 | blr | 108 | blr |
107 | 109 | ||
108 | _GLOBAL(memchr) | 110 | _GLOBAL(memchr) |
109 | cmpwi 0,r5,0 | 111 | PPC_LCMPI 0,r5,0 |
110 | ble- 2f | 112 | beq- 2f |
111 | mtctr r5 | 113 | mtctr r5 |
112 | addi r3,r3,-1 | 114 | addi r3,r3,-1 |
113 | 1: lbzu r0,1(r3) | 115 | 1: lbzu r0,1(r3) |