This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]