summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-11-29 18:51:24 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-11-29 18:51:24 +0000
commit515bd3a026be14e64a5724080a5e256d99ddb254 (patch)
treea811163cdac897264aacdef90759cfaa4f0e26e2
parentc1c0b85bc93b6c8d536cff811022e09e0fae1be7 (diff)
it should not be necessary to clear the direction flag
ok deraadt
-rw-r--r--sys/lib/libkern/arch/amd64/bcmp.S1
-rw-r--r--sys/lib/libkern/arch/amd64/bzero.S1
-rw-r--r--sys/lib/libkern/arch/amd64/memchr.S1
-rw-r--r--sys/lib/libkern/arch/amd64/memcmp.S1
-rw-r--r--sys/lib/libkern/arch/amd64/memmove.S1
-rw-r--r--sys/lib/libkern/arch/amd64/memset.S2
-rw-r--r--sys/lib/libkern/arch/amd64/scanc.S1
-rw-r--r--sys/lib/libkern/arch/amd64/skpc.S1
-rw-r--r--sys/lib/libkern/arch/i386/bcmp.S3
-rw-r--r--sys/lib/libkern/arch/i386/bzero.S3
-rw-r--r--sys/lib/libkern/arch/i386/memchr.S3
-rw-r--r--sys/lib/libkern/arch/i386/memcmp.S3
-rw-r--r--sys/lib/libkern/arch/i386/memmove.S3
-rw-r--r--sys/lib/libkern/arch/i386/memset.S4
-rw-r--r--sys/lib/libkern/arch/i386/scanc.S3
-rw-r--r--sys/lib/libkern/arch/i386/skpc.S3
16 files changed, 8 insertions, 26 deletions
diff --git a/sys/lib/libkern/arch/amd64/bcmp.S b/sys/lib/libkern/arch/amd64/bcmp.S
index 3c96a90b340..4cb1b3d6894 100644
--- a/sys/lib/libkern/arch/amd64/bcmp.S
+++ b/sys/lib/libkern/arch/amd64/bcmp.S
@@ -2,7 +2,6 @@
ENTRY(bcmp)
xorl %eax,%eax /* clear return value */
- cld /* set compare direction forward */
movq %rdx,%rcx /* compare by words */
shrq $3,%rcx
diff --git a/sys/lib/libkern/arch/amd64/bzero.S b/sys/lib/libkern/arch/amd64/bzero.S
index 76adafc20ab..354e2066ed3 100644
--- a/sys/lib/libkern/arch/amd64/bzero.S
+++ b/sys/lib/libkern/arch/amd64/bzero.S
@@ -9,7 +9,6 @@
ENTRY(bzero)
movq %rsi,%rdx
- cld /* set fill direction forward */
xorq %rax,%rax /* set fill data to 0 */
/*
diff --git a/sys/lib/libkern/arch/amd64/memchr.S b/sys/lib/libkern/arch/amd64/memchr.S
index 88fa37462d2..1738e17f8ee 100644
--- a/sys/lib/libkern/arch/amd64/memchr.S
+++ b/sys/lib/libkern/arch/amd64/memchr.S
@@ -11,7 +11,6 @@ ENTRY(memchr)
movq %rdx,%rcx /* set length of search */
testq %rcx,%rcx /* test for len == 0 */
jz L1
- cld /* set search forward */
repne /* search! */
scasb
jne L1 /* scan failed, return null */
diff --git a/sys/lib/libkern/arch/amd64/memcmp.S b/sys/lib/libkern/arch/amd64/memcmp.S
index d32c66d5b93..0d97f6a9bd2 100644
--- a/sys/lib/libkern/arch/amd64/memcmp.S
+++ b/sys/lib/libkern/arch/amd64/memcmp.S
@@ -7,7 +7,6 @@
#include <machine/asm.h>
ENTRY(memcmp)
- cld /* set compare direction forward */
movq %rdx,%rcx /* compare by longs */
shrq $3,%rcx
repe
diff --git a/sys/lib/libkern/arch/amd64/memmove.S b/sys/lib/libkern/arch/amd64/memmove.S
index 1516c743660..351e4d53a49 100644
--- a/sys/lib/libkern/arch/amd64/memmove.S
+++ b/sys/lib/libkern/arch/amd64/memmove.S
@@ -57,7 +57,6 @@ ENTRY(memcpy)
movq %rdi,%r11 /* save dest */
movq %rdx,%rcx
2:
- cld /* copy forwards. */
shrq $3,%rcx /* copy by words */
rep
movsq
diff --git a/sys/lib/libkern/arch/amd64/memset.S b/sys/lib/libkern/arch/amd64/memset.S
index 670d9426b13..67d6404e932 100644
--- a/sys/lib/libkern/arch/amd64/memset.S
+++ b/sys/lib/libkern/arch/amd64/memset.S
@@ -12,8 +12,6 @@ ENTRY(memset)
movq %rdx,%rcx
movq %rdi,%r11
- cld /* set fill direction forward */
-
/*
* if the string is too short, it's really not worth the overhead
* of aligning to word boundaries, etc. So we jump to a plain
diff --git a/sys/lib/libkern/arch/amd64/scanc.S b/sys/lib/libkern/arch/amd64/scanc.S
index f125ed295d3..4ecaae3c15b 100644
--- a/sys/lib/libkern/arch/amd64/scanc.S
+++ b/sys/lib/libkern/arch/amd64/scanc.S
@@ -43,7 +43,6 @@ ENTRY(scanc)
jz 2f
movq %r11,%rdi
xorq %rax,%rax
- cld
1:
lodsb
testb %dl,(%rax,%rdi)
diff --git a/sys/lib/libkern/arch/amd64/skpc.S b/sys/lib/libkern/arch/amd64/skpc.S
index 7addfa9b74e..5942a1c07e8 100644
--- a/sys/lib/libkern/arch/amd64/skpc.S
+++ b/sys/lib/libkern/arch/amd64/skpc.S
@@ -39,7 +39,6 @@ ENTRY(skpc)
movl %edi,%eax
movq %rsi,%rcx
movq %rdx,%rdi
- cld
repe
scasb
je 1f
diff --git a/sys/lib/libkern/arch/i386/bcmp.S b/sys/lib/libkern/arch/i386/bcmp.S
index e1284525257..cfe197f82b3 100644
--- a/sys/lib/libkern/arch/i386/bcmp.S
+++ b/sys/lib/libkern/arch/i386/bcmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcmp.S,v 1.2 1996/09/27 06:47:44 mickey Exp $ */
+/* $OpenBSD: bcmp.S,v 1.3 2014/11/29 18:51:23 tedu Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -13,7 +13,6 @@ ENTRY(bcmp)
movl 12(%esp),%edi
movl 16(%esp),%esi
xorl %eax,%eax /* clear return value */
- cld /* set compare direction forward */
movl 20(%esp),%ecx /* compare by words */
shrl $2,%ecx
diff --git a/sys/lib/libkern/arch/i386/bzero.S b/sys/lib/libkern/arch/i386/bzero.S
index 3bf97192de3..82b64b4d663 100644
--- a/sys/lib/libkern/arch/i386/bzero.S
+++ b/sys/lib/libkern/arch/i386/bzero.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: bzero.S,v 1.4 2007/11/25 18:25:35 deraadt Exp $ */
+/* $OpenBSD: bzero.S,v 1.5 2014/11/29 18:51:23 tedu Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -13,7 +13,6 @@ ENTRY(bzero)
movl 8(%esp),%edi
movl 12(%esp),%edx
- cld /* set fill direction forward */
xorl %eax,%eax /* set fill data to 0 */
/*
diff --git a/sys/lib/libkern/arch/i386/memchr.S b/sys/lib/libkern/arch/i386/memchr.S
index 43f7a91e0a1..a09bad1c87b 100644
--- a/sys/lib/libkern/arch/i386/memchr.S
+++ b/sys/lib/libkern/arch/i386/memchr.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memchr.S,v 1.1 1997/11/04 19:08:06 chuck Exp $ */
+/* $OpenBSD: memchr.S,v 1.2 2014/11/29 18:51:23 tedu Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -14,7 +14,6 @@ ENTRY(memchr)
movl 16(%esp),%ecx /* set length of search */
testl %ecx,%ecx /* test for len == 0 */
jz L1
- cld /* set search forward */
repne /* search! */
scasb
jne L1 /* scan failed, return null */
diff --git a/sys/lib/libkern/arch/i386/memcmp.S b/sys/lib/libkern/arch/i386/memcmp.S
index 4ad4fd46469..1e28d7f4f66 100644
--- a/sys/lib/libkern/arch/i386/memcmp.S
+++ b/sys/lib/libkern/arch/i386/memcmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memcmp.S,v 1.1 2000/06/16 19:56:54 millert Exp $ */
+/* $OpenBSD: memcmp.S,v 1.2 2014/11/29 18:51:23 tedu Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -12,7 +12,6 @@ ENTRY(memcmp)
pushl %esi
movl 12(%esp),%edi
movl 16(%esp),%esi
- cld /* set compare direction forward */
movl 20(%esp),%ecx /* compare by words */
shrl $2,%ecx
diff --git a/sys/lib/libkern/arch/i386/memmove.S b/sys/lib/libkern/arch/i386/memmove.S
index a88b08a5114..9e6edf290b2 100644
--- a/sys/lib/libkern/arch/i386/memmove.S
+++ b/sys/lib/libkern/arch/i386/memmove.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memmove.S,v 1.6 2014/01/09 05:39:41 tedu Exp $ */
+/* $OpenBSD: memmove.S,v 1.7 2014/11/29 18:51:23 tedu Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -74,7 +74,6 @@ ENTRY(memcpy)
movl 20(%esp),%ecx
docopyf:
movl %edi,%eax # setup return value for memcpy/memmove
- cld # copy forward
shrl $2,%ecx # copy by 32-bit words
rep
movsl
diff --git a/sys/lib/libkern/arch/i386/memset.S b/sys/lib/libkern/arch/i386/memset.S
index 46bfd06fbc2..f95f7bac317 100644
--- a/sys/lib/libkern/arch/i386/memset.S
+++ b/sys/lib/libkern/arch/i386/memset.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memset.S,v 1.3 2007/05/25 20:32:29 krw Exp $ */
+/* $OpenBSD: memset.S,v 1.4 2014/11/29 18:51:23 tedu Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -15,8 +15,6 @@ ENTRY(memset)
movl 20(%esp),%ecx
pushl %edi /* push address of buffer */
- cld /* set fill direction forward */
-
/*
* if the string is too short, it's really not worth the overhead
* of aligning to word boundaries, etc. So we jump to a plain
diff --git a/sys/lib/libkern/arch/i386/scanc.S b/sys/lib/libkern/arch/i386/scanc.S
index 45759a1d43d..cc36a7878af 100644
--- a/sys/lib/libkern/arch/i386/scanc.S
+++ b/sys/lib/libkern/arch/i386/scanc.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: scanc.S,v 1.2 1996/09/27 06:47:48 mickey Exp $ */
+/* $OpenBSD: scanc.S,v 1.3 2014/11/29 18:51:23 tedu Exp $ */
/* $NetBSD: scanc.S,v 1.5 1994/10/26 06:39:13 cgd Exp $ */
/*
@@ -42,7 +42,6 @@ ENTRY(scanc)
movl 20(%esp),%edi
movb 24(%esp),%dl
xorl %eax,%eax
- cld
1:
lodsb
testb %dl,(%eax,%edi)
diff --git a/sys/lib/libkern/arch/i386/skpc.S b/sys/lib/libkern/arch/i386/skpc.S
index 7f21c1e1fa8..05f4b0484f8 100644
--- a/sys/lib/libkern/arch/i386/skpc.S
+++ b/sys/lib/libkern/arch/i386/skpc.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: skpc.S,v 1.2 1996/09/27 06:47:49 mickey Exp $ */
+/* $OpenBSD: skpc.S,v 1.3 2014/11/29 18:51:23 tedu Exp $ */
/* $NetBSD: skpc.S,v 1.2 1994/10/26 06:39:15 cgd Exp $ */
/*
@@ -37,7 +37,6 @@ ENTRY(skpc)
movl 16(%esp),%edi
movl 12(%esp),%ecx
movl 8(%esp),%eax
- cld
repe
scasb
je 1f