summaryrefslogtreecommitdiff
path: root/libc/string/x86_64/strchr.S
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string/x86_64/strchr.S')
-rw-r--r--libc/string/x86_64/strchr.S12
1 files changed, 8 insertions, 4 deletions
diff --git a/libc/string/x86_64/strchr.S b/libc/string/x86_64/strchr.S
index c357bfd03..9ef46b7f2 100644
--- a/libc/string/x86_64/strchr.S
+++ b/libc/string/x86_64/strchr.S
@@ -92,7 +92,8 @@ ENTRY (BP_SYM (strchr))
each of whose bytes is C. This turns each byte that is C
into a zero. */
- .p2align 4
+ /* Next 3 insns are 10 bytes total, make sure we decode them in one go */
+ .p2align 4,,10
4:
/* Main Loop is unrolled 4 times. */
/* First unroll. */
@@ -230,8 +231,11 @@ ENTRY (BP_SYM (strchr))
reversed. */
- .p2align 4 /* Align, it's a jump target. */
-3: movq %r9,%rdx /* move to %rdx so that we can access bytes */
+ /* Align, it's a jump target. */
+ /* Next 3 insns are 9 bytes total, make sure we decode them in one go */
+ .p2align 4,,9
+3:
+ movq %r9,%rdx /* move to %rdx so that we can access bytes */
subq $8,%rax /* correct pointer increment. */
testb %cl, %cl /* is first byte C? */
jz 6f /* yes => return pointer */
@@ -281,7 +285,7 @@ ENTRY (BP_SYM (strchr))
incq %rax
6:
- nop
+ /* nop - huh?? */
retq
END (BP_SYM (strchr))