From: Matheus Castanho <msc@linux.ibm.com>
To: Paul E Murphy <murphyp@linux.ibm.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] powerpc: Add optimized strlen for POWER10
Date: Thu, 22 Apr 2021 09:30:56 -0300 [thread overview]
Message-ID: <87eef21oxr.fsf@linux.ibm.com> (raw)
In-Reply-To: <e11dcfae-431f-9267-cc0d-f586c38b651c@linux.ibm.com>
Paul E Murphy <murphyp@linux.ibm.com> writes:
> On 4/16/21 4:24 PM, Matheus Castanho via Libc-alpha wrote:
>
>> diff --git a/sysdeps/powerpc/powerpc64/le/power10/strlen.S b/sysdeps/powerpc/powerpc64/le/power10/strlen.S
>> new file mode 100644
>> index 0000000000..5218a2277c
>> --- /dev/null
>> +++ b/sysdeps/powerpc/powerpc64/le/power10/strlen.S
>> @@ -0,0 +1,219 @@
>> +/* Optimized strlen implementation for POWER10 LE.
>> + Copyright (C) 2021 Free Software Foundation, Inc.
>> + This file is part of the GNU C Library.
>> +
>> + The GNU C Library is free software; you can redistribute it and/or
>> + modify it under the terms of the GNU Lesser General Public
>> + License as published by the Free Software Foundation; either
>> + version 2.1 of the License, or (at your option) any later version.
>> +
>> + The GNU C Library is distributed in the hope that it will be useful,
>> + but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + Lesser General Public License for more details.
>> +
>> + You should have received a copy of the GNU Lesser General Public
>> + License along with the GNU C Library; if not, see
>> + <https://www.gnu.org/licenses/>. */
>> +
>> +#include <sysdep.h>
>> +
>> +#ifndef STRLEN
>> +# define STRLEN __strlen
>> +# define DEFINE_STRLEN_HIDDEN_DEF 1
>> +#endif
>> +
>> +#define VEXTRACTBM(rt,vrb) \
>> + .long(((4)<<(32-6)) \
>> + | ((rt)<<(32-11)) \
>> + | ((8)<<(32-16)) \
>> + | ((vrb)<<(32-21)) \
>> + | 1602)
>> +
>> +#define LXVP(xtp,dq,ra) \
>> + .long(((6)<<(32-6)) \
>> + | ((((xtp)-32)>>1)<<(32-10)) \
>> + | ((1)<<(32-11)) \
>> + | ((ra)<<(32-16)) \
>> + | dq)
>
> Can you add a comment to these noting the minimum version of binutils
> which supports these instructions?
>
>> +
>> +#define CHECK16(reg,offset,addr,label) \
>> + lxv reg+32,offset(addr); \
>> + vcmpequb. reg,reg,v18; \
>> + bne cr6,L(label);
>
> Maybe rename reg to vreg for clarity?
>
> With the trivial comments above addressed, I think this patch is OK.
Thanks for the review. Just posted v2 [1] with the suggested fixes.
[1] https://sourceware.org/pipermail/libc-alpha/2021-April/125307.html
--
Matheus Castanho
prev parent reply other threads:[~2021-04-22 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 21:24 Matheus Castanho
2021-04-20 21:42 ` Paul E Murphy
2021-04-22 12:30 ` Matheus Castanho [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eef21oxr.fsf@linux.ibm.com \
--to=msc@linux.ibm.com \
--cc=libc-alpha@sourceware.org \
--cc=murphyp@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).