summaryrefslogtreecommitdiffstats
path: root/sys/lib/libkern
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2012-01-17 21:31:19 +0000
committermikeb <mikeb@openbsd.org>2012-01-17 21:31:19 +0000
commitbec961c0e40131e83f0a7d848075a8cd951c1c00 (patch)
treef0cde15bcac6f5b61662da98034af7faadcfe634 /sys/lib/libkern
parentFix trailing whitespace. (diff)
downloadwireguard-openbsd-bec961c0e40131e83f0a7d848075a8cd951c1c00.tar.xz
wireguard-openbsd-bec961c0e40131e83f0a7d848075a8cd951c1c00.zip
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.S17
-rw-r--r--sys/lib/libkern/arch/i386/strlen.S21
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