From: Paul E Murphy <murphyp@linux.ibm.com>
To: Matheus Castanho <msc@linux.ibm.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] powerpc: Add optimized strlen for POWER10
Date: Tue, 20 Apr 2021 16:42:00 -0500 [thread overview]
Message-ID: <e11dcfae-431f-9267-cc0d-f586c38b651c@linux.ibm.com> (raw)
In-Reply-To: <20210416212440.75292-1-msc@linux.ibm.com>
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.
next prev parent reply other threads:[~2021-04-20 21:42 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 [this message]
2021-04-22 12:30 ` Matheus Castanho
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=e11dcfae-431f-9267-cc0d-f586c38b651c@linux.ibm.com \
--to=murphyp@linux.ibm.com \
--cc=libc-alpha@sourceware.org \
--cc=msc@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).