This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Improve swap optimization to modify general xxpermdi patterns
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 30 Aug 2015 20:08:09 -0400
- Subject: Re: [PATCH, rs6000] Improve swap optimization to modify general xxpermdi patterns
- Authentication-results: sourceware.org; auth=none
- References: <1440976788 dot 4682 dot 15 dot camel at gnopaine>
On Sun, Aug 30, 2015 at 7:19 PM, Bill Schmidt
<wschmidt@linux.vnet.ibm.com> wrote:
> Hi,
>
> The VSX swap optimization currently misses opportunities to optimize
> loops when expressions corresponding to xxpermdi instructions are
> present (other than xxswapd instructions associated with loads and
> stores). These occur commonly when interleaving vector double or vector
> unsigned long operands, or when concatenating two doubles or unsigned
> longs to make a V2DI or V2DF result. This patch adds logic to recognize
> these insns and adjust them to account for swapped doublewords in the
> computation.
>
> Both opportunities arise in a simple test case that performs a reduction
> on complex multiplications, which I've added here.
>
> Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no
> regressions. Is this ok for trunk?
>
> Thanks,
> Bill
>
>
> [gcc]
>
> 2015-08-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
>
> * config/rs6000/rs6000.c (swap_web_entry): Enlarge
> special_handling bitfield.
> (special_handling_values): Add SH_XXPERMDI and SH_CONCAT.
> (rtx_is_swappable_p): Add handling for vec_select/vec_concat
> form
> that represents a general xxpermdi.
> (insn_is_swappable_p): Add handling for vec_concat of two
> doublewords, which maps to a specific xxpermdi.
> (adjust_xxpermdi): New function.
> (adjust_concat): Likewise.
> (handle_special_swappables): Call adjust_xxpermdi and
> adjust_concat.
> (dump_swap_insn_table): Handle SH_XXPERMDI and SH_CONCAT.
>
> [gcc/testsuite]
>
> 2015-08-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
>
> * gcc.target/powerpc/swaps-p8-19.c: New test.
Okay.
Thanks, David