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]

Re: [ARM] architecture specific subdirectories & optimised memchr [V5]


On Fri, 2 Dec 2011, Dr. David Alan Gilbert wrote:

> +	@ Work up to an aligned point
> +5:
> +	ldrb	r3, [r0],#1
> +	subs	r2, r2, #1
> +	cmp	r3, r1
> +	beq	50f		@ If it matches exit found
> +	tst	r0, #7
> +	cbz	r2, 40f		@ If we run off the end, exit not found

This loop is started with at least 16 bytes available and needs to skip at 
most 7 bytes to get to an aligned point, so I don't see a need for this 
test for running off the end in this loop.  That is, as far as I can see 
that cbz instruction could safely be removed.  Otherwise the patch looks 
OK (if the cbz instruction is indeed unneeded, test and post a version 
without that instruction and I'll commmit it).

-- 
Joseph S. Myers
joseph@codesourcery.com


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