Lines Matching +full:n +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0
3 * Most of the string-functions are rather heavily hand-optimized,
7 * used through-out, making for "slightly" unclear code :-)
22 asm volatile("1:\tlodsb\n\t" in strcpy()
23 "stosb\n\t" in strcpy()
24 "testb %%al,%%al\n\t" in strcpy()
25 "jne 1b" in strcpy()
27 : "0" (src), "1" (dest) : "memory"); in strcpy()
37 asm volatile("1:\tdecl %2\n\t" in strncpy()
38 "js 2f\n\t" in strncpy()
39 "lodsb\n\t" in strncpy()
40 "stosb\n\t" in strncpy()
41 "testb %%al,%%al\n\t" in strncpy()
42 "jne 1b\n\t" in strncpy()
43 "rep\n\t" in strncpy()
44 "stosb\n" in strncpy()
47 : "0" (src), "1" (dest), "2" (count) : "memory"); in strncpy()
57 asm volatile("repne\n\t" in strcat()
58 "scasb\n\t" in strcat()
59 "decl %1\n" in strcat()
60 "1:\tlodsb\n\t" in strcat()
61 "stosb\n\t" in strcat()
62 "testb %%al,%%al\n\t" in strcat()
63 "jne 1b" in strcat()
65 : "0" (src), "1" (dest), "2" (0), "3" (0xffffffffu) : "memory"); in strcat()
75 asm volatile("repne\n\t" in strncat()
76 "scasb\n\t" in strncat()
77 "decl %1\n\t" in strncat()
78 "movl %8,%3\n" in strncat()
79 "1:\tdecl %3\n\t" in strncat()
80 "js 2f\n\t" in strncat()
81 "lodsb\n\t" in strncat()
82 "stosb\n\t" in strncat()
83 "testb %%al,%%al\n\t" in strncat()
84 "jne 1b\n" in strncat()
85 "2:\txorl %2,%2\n\t" in strncat()
88 : "0" (src), "1" (dest), "2" (0), "3" (0xffffffffu), "g" (count) in strncat()
100 asm volatile("1:\tlodsb\n\t" in strcmp()
101 "scasb\n\t" in strcmp()
102 "jne 2f\n\t" in strcmp()
103 "testb %%al,%%al\n\t" in strcmp()
104 "jne 1b\n\t" in strcmp()
105 "xorl %%eax,%%eax\n\t" in strcmp()
106 "jmp 3f\n" in strcmp()
107 "2:\tsbbl %%eax,%%eax\n\t" in strcmp()
108 "orb $1,%%al\n" in strcmp()
111 : "1" (cs), "2" (ct) in strcmp()
123 asm volatile("1:\tdecl %3\n\t" in strncmp()
124 "js 2f\n\t" in strncmp()
125 "lodsb\n\t" in strncmp()
126 "scasb\n\t" in strncmp()
127 "jne 3f\n\t" in strncmp()
128 "testb %%al,%%al\n\t" in strncmp()
129 "jne 1b\n" in strncmp()
130 "2:\txorl %%eax,%%eax\n\t" in strncmp()
131 "jmp 4f\n" in strncmp()
132 "3:\tsbbl %%eax,%%eax\n\t" in strncmp()
133 "orb $1,%%al\n" in strncmp()
136 : "1" (cs), "2" (ct), "3" (count) in strncmp()
148 asm volatile("movb %%al,%%ah\n" in strchr()
149 "1:\tlodsb\n\t" in strchr()
150 "cmpb %%ah,%%al\n\t" in strchr()
151 "je 2f\n\t" in strchr()
152 "testb %%al,%%al\n\t" in strchr()
153 "jne 1b\n\t" in strchr()
154 "movl $1,%1\n" in strchr()
155 "2:\tmovl %1,%0\n\t" in strchr()
158 : "1" (s), "0" (c) in strchr()
170 asm volatile("repne\n\t" in strlen()
173 : "1" (s), "a" (0), "0" (0xffffffffu) in strlen()
175 return ~res - 1; in strlen()
187 asm volatile("repne\n\t" in memchr()
188 "scasb\n\t" in memchr()
189 "je 1f\n\t" in memchr()
190 "movl $1,%0\n" in memchr()
191 "1:\tdecl %0" in memchr()
193 : "a" (c), "0" (cs), "1" (count) in memchr()
205 asm volatile("repnz; scasb\n\t" in memscan()
206 "jnz 1f\n\t" in memscan()
207 "dec %%edi\n" in memscan()
208 "1:" in memscan()
210 : "0" (addr), "1" (size), "a" (c) in memscan()
222 asm volatile("movl %2,%0\n\t" in strnlen()
223 "jmp 2f\n" in strnlen()
224 "1:\tcmpb $0,(%0)\n\t" in strnlen()
225 "je 3f\n\t" in strnlen()
226 "incl %0\n" in strnlen()
227 "2:\tdecl %1\n\t" in strnlen()
228 "cmpl $-1,%1\n\t" in strnlen()
229 "jne 1b\n" in strnlen()
232 : "c" (s), "1" (count) in strnlen()