This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] x86-64: Update strlen.S to support wcslen/wcsnlen
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 5 Jun 2017 07:24:45 -0700
- Subject: Re: [PATCH] x86-64: Update strlen.S to support wcslen/wcsnlen
- Authentication-results: sourceware.org; auth=none
- References: <20170520135619.GA17481@gmail.com> <CAMe9rOrik_jJkM+vd9n7LuPEUR=xM7T8MC1cMiFXgnPsYUiTEw@mail.gmail.com>
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.