From 2dd1fb6ff5995c53dee2aaa51919d3338b1f05a6 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 28 May 2008 14:00:39 +0000 Subject: [PATCH] Fix bug in previous patch. * libc/machine/i386/memset.S (memset): Mask second arg correctly. --- newlib/ChangeLog | 11 ++++++++--- newlib/libc/machine/i386/memset.S | 3 +-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 2e9ecc471..b46b1093c 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2008-05-28 Eric Blake + + Fix bug in previous patch. + * libc/machine/i386/memset.S (memset): Mask second arg correctly. + 2008-05-27 Jeff Johnston * libc/string/memset.c: Fix documented prototype to remove @@ -10,16 +15,16 @@ Pre-align pointer so unaligned searches aren't penalized. * libc/machine/i386/memchr.S (memchr) [!__OPTIMIZE_SIZE__]: Word operations are faster than repnz byte searches. - + 2008-05-26 Eric Blake Optimize the generic and x86 memset. * libc/string/memset.c (memset) [!__OPTIMIZE_SIZE__]: Pre-align pointer so unaligned stores aren't penalized. - * libc/machine/i386/memset.S (memset): [!__OPTIMIZE_SIZE__]: + * libc/machine/i386/memset.S (memset) [!__OPTIMIZE_SIZE__]: Pre-align pointer so unaligned stores aren't penalized. Prefer 8-byte over 4-byte alignment. Reduce register pressure. - + 2008-05-26 Eric Blake Optimize the generic and x86 strlen. diff --git a/newlib/libc/machine/i386/memset.S b/newlib/libc/machine/i386/memset.S index 36637fc21..6eb2cd6da 100644 --- a/newlib/libc/machine/i386/memset.S +++ b/newlib/libc/machine/i386/memset.S @@ -19,7 +19,7 @@ SYM (memset): movl esp,ebp pushl edi movl 8(ebp),edi - movl 12(ebp),eax + movzbl 12(ebp),eax movl 16(ebp),ecx cld @@ -27,7 +27,6 @@ SYM (memset): /* Less than 16 bytes won't benefit from the 'rep stosl' loop. */ cmpl $16,ecx jbe .L19 - cbw testl $7,edi je .L10