123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- #include "_glibc_inc.h"
- .text
- ENTRY (BP_SYM (strchr))
-
- movq %rdi, %rdx
- andl $7, %edx
- movq %rdi, %rax
- jz 1f
- neg %edx
- addl $8, %edx
-
- 0: movb (%rax), %cl
- cmpb %cl,%sil
- je 6f
- testb %cl,%cl
- je 7f
- incq %rax
- decl %edx
- jnz 0b
- 1:
-
-
- movabs $0x0101010101010101,%r9
- movzbl %sil,%edx
- imul %rdx,%r9
- movq $0xfefefefefefefeff, %r8
-
-
- .p2align 4,,10
- 4:
-
-
- movq (%rax), %rcx
- addq $8,%rax
- movq %r8, %rdx
- xorq %r9, %rcx
- addq %rcx, %rdx
- jnc 3f
- xorq %rcx, %rdx
- orq %r8, %rdx
- incq %rdx
- jnz 3f
-
- xorq %r9, %rcx
- movq %r8, %rdx
- addq %rcx, %rdx
- jnc 7f
- xorq %rcx, %rdx
- orq %r8, %rdx
- incq %rdx
- jnz 7f
-
- movq (%rax), %rcx
- addq $8,%rax
- movq %r8, %rdx
- xorq %r9, %rcx
- addq %rcx, %rdx
- jnc 3f
- xorq %rcx, %rdx
- orq %r8, %rdx
- incq %rdx
- jnz 3f
-
- xorq %r9, %rcx
- movq %r8, %rdx
- addq %rcx, %rdx
- jnc 7f
- xorq %rcx, %rdx
- orq %r8, %rdx
- incq %rdx
- jnz 7f
-
- movq (%rax), %rcx
- addq $8,%rax
- movq %r8, %rdx
- xorq %r9, %rcx
- addq %rcx, %rdx
- jnc 3f
- xorq %rcx, %rdx
- orq %r8, %rdx
- incq %rdx
- jnz 3f
-
- xorq %r9, %rcx
- movq %r8, %rdx
- addq %rcx, %rdx
- jnc 7f
- xorq %rcx, %rdx
- orq %r8, %rdx
- incq %rdx
- jnz 7f
-
- movq (%rax), %rcx
- addq $8,%rax
- movq %r8, %rdx
- xorq %r9, %rcx
- addq %rcx, %rdx
- jnc 3f
- xorq %rcx, %rdx
- orq %r8, %rdx
- incq %rdx
- jnz 3f
-
- xorq %r9, %rcx
- movq %r8, %rdx
- addq %rcx, %rdx
- jnc 7f
- xorq %rcx, %rdx
- orq %r8, %rdx
- incq %rdx
- jz 4b
- 7:
- xorl %eax, %eax
- retq
-
-
-
- .p2align 4,,9
- 3:
- movq %r9,%rdx
- subq $8,%rax
- testb %cl, %cl
- jz 6f
- cmpb %dl, %cl
- je 7b
- incq %rax
- testb %ch, %ch
- jz 6f
- cmpb %dl, %ch
- je 7b
- incq %rax
- shrq $16, %rcx
- testb %cl, %cl
- jz 6f
- cmpb %dl, %cl
- je 7b
- incq %rax
- testb %ch, %ch
- jz 6f
- cmpb %dl, %ch
- je 7b
- incq %rax
- shrq $16, %rcx
- testb %cl, %cl
- jz 6f
- cmpb %dl, %cl
- je 7b
- incq %rax
- testb %ch, %ch
- jz 6f
- cmpb %dl, %ch
- je 7b
- incq %rax
- shrq $16, %rcx
- testb %cl, %cl
- jz 6f
- cmpb %dl, %cl
- je 7b
-
- incq %rax
- 6:
-
- retq
- END (BP_SYM (strchr))
- libc_hidden_def(strchr)
- #ifdef __UCLIBC_SUSV3_LEGACY__
- strong_alias (BP_SYM (strchr), BP_SYM (index))
- #endif
|