From: Tulio Magno Quites Machado Filho <tuliom@ascii.art.br>
To: Raphael Moreira Zinsly <rzinsly@linux.ibm.com>,
libc-alpha@sourceware.org
Cc: murphyp@linux.ibm.com, pc@us.ibm.com, msc@linux.ibm.com
Subject: Re: [PATCH v3 1/2] powerpc: Add optimized strncpy for POWER9
Date: Thu, 12 Nov 2020 14:09:59 -0300 [thread overview]
Message-ID: <87a6vmfqmw.fsf@linux.ibm.com> (raw)
In-Reply-To: <20200929152103.18564-1-rzinsly@linux.ibm.com>
Raphael Moreira Zinsly <rzinsly@linux.ibm.com> writes:
> Similar to the strcpy P9 optimization, this version uses VSX to improve
> performance.
Remember to add the Reviewed-by: lines you collected in previous versions. ;-)
> +#define FRAMESIZE (FRAME_MIN_SIZE+48)
I think you actually meant to use FRAME_MIN_SIZE+8 here.
Fixed.
> +L(zero_padding_end):
> + sldi r10,r5,56 /* stxvl wants size in top 8 bits */
> + stxvl v18,r11,r10 /* Partial store */
> + blr
> +
> + .align 4
> +L(zero_padding_memset):
> + std r30,-8(r1) /* Save r30 on the stack. */
This requires to add CFI:
cfi_offset(r30, -8)
Done.
> +#if defined __LITTLE_ENDIAN__ && IS_IN (libc)
> +#define STRNCPY __strncpy_power9
> +
> +#undef libc_hidden_builtin_def
> +#define libc_hidden_builtin_def(name)
> +
> +/* memset is used to pad the end of the string. */
> +#define MEMSET __memset_power8
> +#ifdef SHARED
> +#define MEMSET_is_local
Wrong indentation in the previous lines. Fixed.
I wonder if we can improve this and stop depending on the list of memset
implementations on this file.
Anyway, this isn't new and is a future work.
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
> index 7bacf28aca..3f2108ddae 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
> +++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
> @@ -28,11 +28,19 @@
> extern __typeof (strncpy) __strncpy_ppc attribute_hidden;
> extern __typeof (strncpy) __strncpy_power7 attribute_hidden;
> extern __typeof (strncpy) __strncpy_power8 attribute_hidden;
> +# ifdef __LITTLE_ENDIAN__
> +extern __typeof (strncpy) __strncpy_power9 attribute_hidden;
> +# endif
> # undef strncpy
>
> /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
> ifunc symbol properly. */
> libc_ifunc_redirected (__redirect_strncpy, strncpy,
> +# ifdef __LITTLE_ENDIAN__
> + (hwcap2 & PPC_FEATURE2_ARCH_3_00) &&
> + (hwcap & PPC_FEATURE_HAS_VSX)
> + ? __strncpy_power9 :
Wrong indentation here. Fixed.
Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Pushed as b9d83bf3eb57.
Thanks!
--
Tulio Magno
prev parent reply other threads:[~2020-11-12 17:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 15:21 Raphael Moreira Zinsly
2020-09-29 15:21 ` [PATCH v3 2/2] powerpc: Add optimized stpncpy " Raphael Moreira Zinsly
2020-09-29 15:23 ` Raphael M Zinsly
2020-09-30 13:42 ` Adhemerval Zanella
2020-09-30 14:21 ` Raphael M Zinsly
2020-09-30 14:46 ` Adhemerval Zanella
2020-11-12 17:12 ` Tulio Magno Quites Machado Filho
2020-09-29 15:22 ` [PATCH v3 1/2] powerpc: Add optimized strncpy " Raphael M Zinsly
2020-10-15 15:20 ` Lucas A. M. Magalhaes
2020-11-12 17:09 ` Tulio Magno Quites Machado Filho [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=87a6vmfqmw.fsf@linux.ibm.com \
--to=tuliom@ascii.art.br \
--cc=libc-alpha@sourceware.org \
--cc=msc@linux.ibm.com \
--cc=murphyp@linux.ibm.com \
--cc=pc@us.ibm.com \
--cc=rzinsly@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).