This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][rs6000][PR target/82190] fix mem size info in rtl generated by memcmp and strncmp/strcmp builtin expansion
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Aaron Sawdey <acsawdey at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Tue, 12 Dec 2017 20:50:59 +0100
- Subject: Re: [PATCH][rs6000][PR target/82190] fix mem size info in rtl generated by memcmp and strncmp/strcmp builtin expansion
- Authentication-results: sourceware.org; auth=none
- References: <1513107641.30918.8.camel@linux.vnet.ibm.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Dec 12, 2017 at 01:40:41PM -0600, Aaron Sawdey wrote:
> 2017-12-12 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
>
> PR target/82190
> * config/rs6000/rs6000-string.c (expand_block_move,
> expand_strn_compare): fix set_mem_size() calls.
That should be capitalized: Fix instead of fix
> --- gcc/config/rs6000/rs6000-string.c (revision 255585)
> +++ gcc/config/rs6000/rs6000-string.c (working copy)
> @@ -1247,6 +1247,9 @@
> if (bytes > rs6000_block_move_inline_limit)
> return 0;
>
> + bool isP8 = (rs6000_cpu == PROCESSOR_POWER8);
> + bool isP9 = (rs6000_cpu == PROCESSOR_POWER9);
> +
> for (offset = 0; bytes > 0; offset += move_bytes, bytes -= move_bytes)
> {
> union {
> @@ -1258,7 +1261,7 @@
>
> /* Altivec first, since it will be faster than a string move
> when it applies, and usually not significantly larger. */
> - if (TARGET_ALTIVEC && bytes >= 16 && align >= 128)
> + if (TARGET_ALTIVEC && bytes >= 16 && (isP8 || isP9 || align >= 128))
> {
> move_bytes = 16;
> mode = V4SImode;
Is this the patch you meant to attach? First of all, it only changes
expand_block_move, not expand_strn_compare, and the change seems more
like an optimization of P8/P9 rather than actual fix (otherwise, wouldn't
it fail on say P7?).
> + return 0;
> +}
> +
> +
Please avoid unnecessary trailing whitespace.
Jakub