diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2012-01-17 21:31:20 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2012-01-17 21:31:20 +0000 |
commit | 8b32f16e7fe9c826ca4e787966cb27b77363be0e (patch) | |
tree | 49d0df613f1fa6f92923e3dfab8a20b3e434655c /sys/lib/libkern | |
parent | 2ad8ee1c3882a4b6e1a9f3dc90f607a6e37d13cd (diff) |
Remove assembly version of strlen from i386 and amd64, where it's
up to 3 times slower than the C code most of the time. This was
brought up by DragonflyBSD guys initially.
ok deraadt, guenther. miod will not miss it.
Diffstat (limited to 'sys/lib/libkern')
-rw-r--r-- | sys/lib/libkern/arch/amd64/strlen.S | 17 | ||||
-rw-r--r-- | sys/lib/libkern/arch/i386/strlen.S | 21 |
2 files changed, 0 insertions, 38 deletions
diff --git a/sys/lib/libkern/arch/amd64/strlen.S b/sys/lib/libkern/arch/amd64/strlen.S deleted file mode 100644 index e4d20696d8e..00000000000 --- a/sys/lib/libkern/arch/amd64/strlen.S +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com> - */ - -#include <machine/asm.h> - -ENTRY(strlen) - cld /* set search forward */ - xorl %eax,%eax /* set search for null terminator */ - movq $-1,%rcx /* set search for lots of characters */ - repne /* search! */ - scasb - notq %rcx /* get length by taking complement */ - leaq -1(%rcx),%rax /* and subtracting one */ - ret diff --git a/sys/lib/libkern/arch/i386/strlen.S b/sys/lib/libkern/arch/i386/strlen.S deleted file mode 100644 index 9d668c8ec12..00000000000 --- a/sys/lib/libkern/arch/i386/strlen.S +++ /dev/null @@ -1,21 +0,0 @@ -/* $OpenBSD: strlen.S,v 1.2 1996/09/27 06:47:51 mickey Exp $ */ - -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - -#include <machine/asm.h> - -ENTRY(strlen) - pushl %edi - movl 8(%esp),%edi /* string address */ - cld /* set search forward */ - xorl %eax,%eax /* set search for null terminator */ - movl $-1,%ecx /* set search for lots of characters */ - repne /* search! */ - scasb - notl %ecx /* get length by taking complement */ - leal -1(%ecx),%eax /* and subtracting one */ - popl %edi - ret |