Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6102 | serge | 1 | |
2 | { |
||
3 | int d0, d1; |
||
4 | register char *__res; |
||
5 | __asm__ __volatile__( |
||
6 | "movl %6,%%edi\n\t" |
||
7 | "repne\n\t" |
||
8 | "scasb\n\t" |
||
9 | "notl %%ecx\n\t" |
||
10 | "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */ |
||
11 | "movl %%ecx,%%edx\n" |
||
12 | "1:\tmovl %6,%%edi\n\t" |
||
13 | "movl %%esi,%%eax\n\t" |
||
14 | "movl %%edx,%%ecx\n\t" |
||
15 | "repe\n\t" |
||
16 | "cmpsb\n\t" |
||
17 | "je 2f\n\t" /* also works for empty string, see above */ |
||
18 | "xchgl %%eax,%%esi\n\t" |
||
19 | "incl %%esi\n\t" |
||
20 | "cmpb $0,-1(%%eax)\n\t" |
||
21 | "jne 1b\n\t" |
||
22 | "xorl %%eax,%%eax\n\t" |
||
23 | "2:" |
||
24 | : "=a" (__res), "=&c" (d0), "=&S" (d1) |
||
25 | : "0" (0), "1" (0xffffffff), "2" (cs), "g" (ct) |
||
26 | : "dx", "di"); |
||
27 | return __res; |
||
28 | } |
||
29 |