summaryrefslogtreecommitdiff
path: root/libc/string/x86_64/strcspn.S
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-04-15 08:23:19 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-04-15 08:23:19 +0000
commit534dfb536f19737f2642ee56dd67a97c5db6a74e (patch)
treefaf1e08295d084cb44c8986fa179d306d6f0a377 /libc/string/x86_64/strcspn.S
parent07bbf922670cce83c0b54f28ad43473d044cae5e (diff)
amd64 string ops: replace some instructions by smaller ones,
e.g. testb $0xff, %cl -> testb %cl, %cl
Diffstat (limited to 'libc/string/x86_64/strcspn.S')
-rw-r--r--libc/string/x86_64/strcspn.S7
1 files changed, 3 insertions, 4 deletions
diff --git a/libc/string/x86_64/strcspn.S b/libc/string/x86_64/strcspn.S
index c02fbbb5f..9563de496 100644
--- a/libc/string/x86_64/strcspn.S
+++ b/libc/string/x86_64/strcspn.S
@@ -26,7 +26,6 @@
#include "_glibc_inc.h"
/* Seems to be unrolled too much */
-/* (and why testb $0xff, %cl, not testb %cl, %cl?) */
/* BEWARE: `#ifdef strcspn' means that strcspn is redefined as `strpbrk' */
#define STRPBRK_P (defined strcspn)
@@ -63,19 +62,19 @@ L(2): movb (%rax), %cl /* get byte from skipset */
movb %cl, (%rsp,%rcx) /* set corresponding byte in skipset table */
movb 1(%rax), %cl /* get byte from skipset */
- testb $0xff, %cl /* is NUL char? */
+ testb %cl, %cl /* is NUL char? */
jz L(1) /* yes => start compare loop */
movb %cl, (%rsp,%rcx) /* set corresponding byte in skipset table */
movb 2(%rax), %cl /* get byte from skipset */
- testb $0xff, %cl /* is NUL char? */
+ testb %cl, %cl /* is NUL char? */
jz L(1) /* yes => start compare loop */
movb %cl, (%rsp,%rcx) /* set corresponding byte in skipset table */
movb 3(%rax), %cl /* get byte from skipset */
addq $4, %rax /* increment skipset pointer */
movb %cl, (%rsp,%rcx) /* set corresponding byte in skipset table */
- testb $0xff, %cl /* is NUL char? */
+ testb %cl, %cl /* is NUL char? */
jnz L(2) /* no => process next dword from skipset */
L(1): leaq -4(%rdx), %rax /* prepare loop */