Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/arch/i386/string PR/29248: Geoff C. Wing: memchr br...
details: https://anonhg.NetBSD.org/src/rev/361ed1cbcd9f
branches: trunk
changeset: 573741:361ed1cbcd9f
user: christos <christos%NetBSD.org@localhost>
date: Sun Feb 06 18:36:32 2005 +0000
description:
PR/29248: Geoff C. Wing: memchr broken after latest commit.
Apply fix submitted by jtc: The problem was that his regression tests
never checked for characters with the high bit set. Change movl to movzbl
where it was not done yet. In addition strrchr.S missed a jump to Lzero.
diffstat:
lib/libc/arch/i386/string/memchr.S | 5 +++--
lib/libc/arch/i386/string/strchr.S | 4 ++--
lib/libc/arch/i386/string/strrchr.S | 4 ++--
3 files changed, 7 insertions(+), 6 deletions(-)
diffs (69 lines):
diff -r 5ab4be1dd5a8 -r 361ed1cbcd9f lib/libc/arch/i386/string/memchr.S
--- a/lib/libc/arch/i386/string/memchr.S Sun Feb 06 18:27:41 2005 +0000
+++ b/lib/libc/arch/i386/string/memchr.S Sun Feb 06 18:36:32 2005 +0000
@@ -6,13 +6,13 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
- RCSID("$NetBSD: memchr.S,v 1.11 2005/02/04 18:12:52 drochner Exp $")
+ RCSID("$NetBSD: memchr.S,v 1.12 2005/02/06 18:36:32 christos Exp $")
#endif
ENTRY(memchr)
pushl %esi
movl 8(%esp),%eax
- movl 12(%esp),%ecx
+ movzbl 12(%esp),%ecx
movl 16(%esp),%esi
/*
@@ -29,6 +29,7 @@
incl %eax
decl %esi
jnz .Lalign
+ jmp .Lzero
.Lword_aligned:
/* copy char to all bytes in word */
diff -r 5ab4be1dd5a8 -r 361ed1cbcd9f lib/libc/arch/i386/string/strchr.S
--- a/lib/libc/arch/i386/string/strchr.S Sun Feb 06 18:27:41 2005 +0000
+++ b/lib/libc/arch/i386/string/strchr.S Sun Feb 06 18:36:32 2005 +0000
@@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
- RCSID("$NetBSD: strchr.S,v 1.5 2005/02/04 18:12:52 drochner Exp $")
+ RCSID("$NetBSD: strchr.S,v 1.6 2005/02/06 18:36:32 christos Exp $")
#endif
#ifdef INDEX
@@ -17,7 +17,7 @@
pushl %esi
pushl %ebx
movl 12(%esp),%eax
- movl 16(%esp),%ecx
+ movzbl 16(%esp),%ecx
/*
* Align to word boundary.
diff -r 5ab4be1dd5a8 -r 361ed1cbcd9f lib/libc/arch/i386/string/strrchr.S
--- a/lib/libc/arch/i386/string/strrchr.S Sun Feb 06 18:27:41 2005 +0000
+++ b/lib/libc/arch/i386/string/strrchr.S Sun Feb 06 18:36:32 2005 +0000
@@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
- RCSID("$NetBSD: strrchr.S,v 1.6 2005/02/04 18:12:52 drochner Exp $")
+ RCSID("$NetBSD: strrchr.S,v 1.7 2005/02/06 18:36:32 christos Exp $")
#endif
#ifdef RINDEX
@@ -18,7 +18,7 @@
pushl %edi
pushl %ebx
movl 16(%esp),%edx
- movl 20(%esp),%ecx
+ movzbl 20(%esp),%ecx
/* zero return value */
xorl %eax,%eax
Home |
Main Index |
Thread Index |
Old Index