[PATCH] x86-64: Update strlen.S to support wcslen/wcsnlen
H.J. Lu
hjl.tools@gmail.com
Mon Jun 5 14:24:00 GMT 2017
On Tue, May 30, 2017 at 3:14 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, May 20, 2017 at 6:56 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> The difference between strlen and wcslen is byte vs int. We can
>> replace pminub and pcmpeqb with pminud and pcmpeqd to turn strlen
>> into wcslen. Tested on Ivy Bridge with benchtests/bench-wcslen.c,
>> the new strlen based wcslen is as fast as the old wcslen.
>>
>> OK for master?
>>
>> H.J.
>> ---
>> * sysdeps/x86_64/strlen.S (PMINU): New.
>> (PCMPEQ): Likewise.
>> (SHIFT_RETURN): Likewise.
>> (FIND_ZERO): Replace pcmpeqb with PCMPEQ.
>> (strlen): Add SHIFT_RETURN before ret. Replace pcmpeqb and
>> pminub with PCMPEQ and PMINU.
>> * sysdeps/x86_64/wcslen.S: Define AS_WCSLEN and strlen.
>> Include "strlen.S".
>> * sysdeps/x86_64/wcsnlen.S: New file.
>
> Here is the updated patch only with SSE2 wcsnlen.S. Any
> comments?
>
I will check it in today.
--
H.J.
More information about the Libc-alpha
mailing list