This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Correct ARM memset for negative numbers
- From: Daniel Jacobowitz <drow at false dot org>
- To: libc-ports at sourceware dot org
- Date: Mon, 10 Oct 2005 11:02:45 -0400
- Subject: Correct ARM memset for negative numbers
This fixes test-memset for ARM: if we have a sign extended integer
argument, we can't use orr to clone it into the upper bits without
clearing the sign bits first. Tested and committed.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-10-10 Daniel Jacobowitz <dan@codesourcery.com>
* sysdeps/arm/memset.S (memset): Correct handling of negative
arguments.
Index: glibc/ports/sysdeps/arm/memset.S
===================================================================
--- glibc.orig/ports/sysdeps/arm/memset.S 2005-10-09 21:26:36.000000000 -0400
+++ glibc/ports/sysdeps/arm/memset.S 2005-10-09 21:26:40.000000000 -0400
@@ -32,6 +32,7 @@ ENTRY(memset)
subne r2, r2, #1
bne 1b
+ and r1, r1, #255 @ clear any sign bits
orr r1, r1, r1, lsl $8
orr r1, r1, r1, lsl $16