From 534dfb536f19737f2642ee56dd67a97c5db6a74e Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 15 Apr 2008 08:23:19 +0000 Subject: amd64 string ops: replace some instructions by smaller ones, e.g. testb $0xff, %cl -> testb %cl, %cl --- libc/string/x86_64/memset.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libc/string/x86_64/memset.S') diff --git a/libc/string/x86_64/memset.S b/libc/string/x86_64/memset.S index 0f054ade6..3092e81eb 100644 --- a/libc/string/x86_64/memset.S +++ b/libc/string/x86_64/memset.S @@ -53,15 +53,15 @@ ENTRY (memset) imul %rax,%r8 #endif test $0x7,%edi /* Check for alignment. */ - je 2f + jz 2f .p2align 4 1: /* Align ptr to 8 byte. */ mov %sil,(%rcx) dec %rdx inc %rcx - test $0x7,%ecx - jne 1b + test $0x7,%cl + jnz 1b 2: /* Check for really large regions. */ mov %rdx,%rax @@ -107,7 +107,7 @@ ENTRY (memset) jne 8b 9: #if BZERO_P - nop /* huh?? */ + /* nothing */ #else /* Load result (only if used as memset). */ mov %rdi,%rax /* start address of destination is result */ -- cgit v1.2.3