This is the mail archive of the 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: [PATCH 20/26] arm: Implement armv6t2 optimized strlen

On 02/27/2013 09:12 AM, Måns Rullgård wrote:
> Richard Henderson <> writes:
>> +ENTRY(strlen)
>> +	@ Loop searching for EOS or C, 8 bytes at a time.
> This comment seems to be for strchr().

Whoops.  As you can imagine there's some amount of cut and paste here.  ;-)

> Subtracting the values (with UQSUB8) from 1 instead would result in a 0
> result any non-zero input and a 1 for "found", i.e. the inverse of what
> you have here.  Testing for a match anywhere in the double-word then
> becomes a single ORRS instruction.  Unless I'm making some stupid mistake.

Yes, this works.  And a good idea for improvement.

> This code could be made to work for any ARMv6 by (conditionally)
> replacing the MOVW/MOVT with some equivalent and the RBIT by REV.  REV
> works since only the lsb in each byte can be set, so the result of CLZ
> will simply be 7 more than we want, and the 3 low-order bits are shifted
> out anyway.

Ah, I'd mis-read the document the first time round and thought uqadd8 was an
armv6t2 instruction.  I'll rearrange all these so that armv6 can benefit.

Which makes patch 3 once again useful... ;-)


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