This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] x86-64: Update strlen.S to support wcslen/wcsnlen


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.


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