[PATCH,rs6000 2/2] Fusion patterns for add-logical/logical-add

2021-04-26 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This patch modifies the function in genfusion.pl for generating the logical-logical patterns so that it can also generate the add-logical and logical-add patterns which are very similar. gcc/ChangeLog: * config/rs6000/genfusion.pl (gen_logical_addsubf): Refactor to

[PATCH,rs6000 1/2] combine patterns for add-add fusion

2021-04-26 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This patch adds a function to genfusion.pl to add a couple more patterns so combine can do fusion of pairs of add and vaddudm instructions. gcc/ChangeLog: * gcc/config/rs6000/genfusion.pl (gen_addadd): New function. * gcc/config/rs6000/fusion.md: Regenerate fi

[PATCH,rs6000 0/2] p10 add-add and add-logical fusion series

2021-04-26 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey Two more sets of combine patterns for p10 fusion. These require the "Add insn types for fusion pairs" patch I posted earlier today. If ok I would like to put these in gcc 12 trunk and backport for 11.2. Thanks, Aaron Aaron Sawdey (2): combine patterns for add-add fusio

[PATCH,rs6000] Test cases for p10 fusion patterns

2021-04-26 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This adds some test cases to make sure that the combine patterns for p10 fusion are working. OK for trunk? gcc/testsuite/ChangeLog: * gcc.target/powerpc/fusion-p10-ldcmpi.c: New file. * gcc.target/powerpc/fusion-p10-2logical.c: New file. --- .../gcc.target/po

[PATCH,rs6000] Add insn types for fusion pairs

2021-04-26 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This adds new values for insn attr type for p10 fusion. The genfusion.pl script is modified to use them, and fusion.md regenerated to capture the new patterns. There are also some formatting only changes to fusion.md that apparently weren't captured after a previous commit of g

[PATCH,rs6000] Tighten predicates for p10 ld/cmpi fusion

2021-03-08 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey PR99070 is caused by a fusion pattern matching that the individual instructions do not match when it is split later. In this case the ld+cmpi patterns were allowing a d-form load address, which the split condition would rightly split, however that left us with something that co

[PATCH,rs6000] [v2] Optimize pcrel access of globals

2021-02-22 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This patch implements a RTL pass that looks for pc-relative loads of the address of an external variable using the PCREL_GOT relocation and a single load or store that uses that external address. Produced by a cast of thousands: * Michael Meissner * Peter Bergner * Bill Sch

[PATCH,rs6000] do not generate fusion.md, update contrib/gcc_update

2021-02-01 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey In a previous fusion-combine patch for rs6000, Segher had asked me to comment out the automatic regeneration of fusion.md. And more recently Edelsohn pointed out that gcc_update needed to fix the timestamp of fusion.md so it didn't get unnecessarily regenerated. OK for trunk i

[PATCH,rs6000] Test cases for p10 fusion patterns

2020-12-11 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This adds some test cases to make sure that the combine patterns for p10 fusion are working. These test cases pass on power10. OK for trunk after the 2 previous patches for the fusion patterns go in? Thanks! Aaron gcc/testsuite/ChangeLog: * gcc.target/powerpc/fusi

[PATCH,rs6000] Fusion patterns for logical-logical

2020-12-10 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This patch adds a new function to genfusion.pl to generate patterns for logical-logical fusion. They are enabled by default for power10 and can be disabled by -mno-power10-fusion-2logical or -mno-power10-fusion. This patch builds on top of the load-cmpi patch posted earlier th

[PATCH,rs6000] Optimize pcrel access of globals [ping]

2020-12-09 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey Ping. I've folded in the changes to comments suggested by Will Schmidt. This patch implements a RTL pass that looks for pc-relative loads of the address of an external variable using the PCREL_GOT relocation and a single load or store that uses that external address. Produced

[PATCH,rs6000] Combine patterns for p10 load-cmpi fusion

2020-12-04 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This patch adds the first batch of patterns to support p10 fusion. These will allow combine to create a single insn for a pair of instructions that that power10 can fuse and execute. These particular ones have the requirement that only cr0 can be used when fusing a load with a

[PATCH,rs6000] Make MMA builtins use opaque modes [v2]

2020-11-19 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey Segher & Bergner - Thanks for the reviews, here's the updated patch after fixing those things. We now have an UNSPEC for xxsetaccz, and an accompanying change to rs6000_rtx_costs to make it be cost 0 so that CSE doesn't try to replace it with a bunch of register moves. If bo

[PATCH] Additional small changes to support opaque modes

2020-11-19 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey After building some larger codes using opaque types and some c++ codes using opaque types it became clear I needed to go through and look for places where opaque types and modes needed to be handled. A whole pile of one-liners. If bootstrap/regtest passes for ppc64le and x86_6

[PATCH] Additional small changes to support opaque modes

2020-11-19 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey After building some larger codes using opaque types and some c++ codes using opaque types it became clear I needed to go through and look for places where opaque types and modes needed to be handled. A whole pile of one-liners. If bootstrap/regtest passes for ppc64le and x86_6

[PATCH, rs6000] Re-enable vector pair memcpy/memmove expansion

2020-11-17 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey After the MMA opaque mode patch goes in, we can re-enable use of vector pair in the inline expansion of memcpy/memmove. After bootstrap/regtest, OK for trunk? Thanks, Aaron gcc/ * config/rs6000/rs6000.c (rs6000_option_override_internal): Enable vector pai

[PATCH,rs6000] Make MMA builtins use opaque modes

2020-11-17 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This patch changes powerpc MMA builtins to use the new opaque mode class and use modes OO (32 bytes) and XO (64 bytes) instead of POI/PXI. Using the opaque modes prevents optimization from trying to do anything with vector pair/quad, which was the problem we were seeing with th

Re: [PATCH] Add MODE_OPAQUE

2020-11-16 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey Richard, Thanks for the review. I think I have resolved everything, as follows: * I was able to remove the const_tiny_rtx initialization for MODE_OPAQUE. If that becomes a problem it's a pretty simple matter to use an UNSPEC to assign a constant to an opaque mode if necessa

[PATCH] Add MODE_OPAQUE

2020-11-13 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey After discussion with Richard Sandiford on IRC, he suggested adding a new mode class MODE_OPAQUE to deal with the problems (PR 96791) we had been having with POImode/PXImode in powerpc target. This patch is the accumulation of changes I needed to make to add this and make it us

Re: [PATCH, rs6000] Optimize pcrel access of globals (updated, ping)

2020-11-04 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey Ping, as it has been a while. This also includes a slight fix to make sure that all references can get optimized. This patch implements a RTL pass that looks for pc-relative loads of the address of an external variable using the PCREL_GOT relocation and a single load or store

[PATCH,rs6000] Add patterns for combine to support p10 fusion

2020-10-26 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This patch adds the first couple patterns to support p10 fusion. These will allow combine to create a single insn for a pair of instructions that that power10 can fuse and execute. These particular ones have the requirement that only cr0 can be used when fusing a load with a co

[PATCH, rs6000] Optimize pcrel access of globals

2020-10-20 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This patch implements a RTL pass that looks for pc-relative loads of the address of an external variable using the PCREL_GOT relocation and a single load or store that uses that external address. It then uses the PCREL_OPT relocation to convert that first load into a single pc-

[PATCH] rs6000: add option -mblock-ops-unaligned-vsx

2020-07-24 Thread acsawdey--- via Gcc-patches
From: Aaron Sawdey This option is mostly being added to provide -mno-block-ops-unaligned-vsx. The default is set the same as -mefficient-unaligned-vsx. This option will control the use of unaligned VSX loads/stores in the inline expansion of memcpy() and memmove(). The use case for this would be

Re: [PATCH][PR target/94542]Don't allow PC-relative addressing for TLS data

2020-04-13 Thread acsawdey via Gcc-patches
On 2020-04-13 10:08, will schmidt wrote: On Fri, 2020-04-10 at 18:00 -0500, acsawdey via Gcc-patches wrote: diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2b6613bcb7e..c77e60a718f 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -24824,15

[PATCH][PR target/94542]Don't allow PC-relative addressing for TLS data

2020-04-10 Thread acsawdey via Gcc-patches
One of the things that address_to_insn_form() is used for is determining whether a PC-relative addressing instruction could be used. In particular predicate pcrel_external_address and function prefixed_paddi_p() both use it for this purpose. So what emerged in PR/94542 is that it should be look

[PATCH 30/30] Changes to xtensa

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/xtensa/xtensa.md (movmemsi): Change name to cpymemsi. --- gcc/config/xtensa/xtensa.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 362e5ff..d1448a0 100644 --- a/gcc/config/x

[PATCH 29/30] Changes to visium

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/visium/visium.h: Change movmem to cpymem in comment. * config/visium/visium.md (movmemsi): Change name to cpymemsi. --- gcc/config/visium/visium.h | 4 ++-- gcc/config/visium/visium.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --g

[PATCH 28/30] Changes to vax

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/vax/vax-protos.h (vax_output_movmemsi): Remove prototype for nonexistent function. * config/vax/vax.h: Change movmem to cpymem in comment. * config/vax/vax.md (movmemhi, movmemhi1): Change movmem to cpymem. --- gcc/config/vax/vax-protos

[PATCH 26/30] Changes to sh

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/sh/sh.md (movmemsi): Change name to cpymemsi. --- gcc/config/sh/sh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 8354377..ed70e34 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.m

[PATCH 27/30] Changes to sparc

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/sparc/sparc.h: Change movmem to cpymem in comment. --- gcc/config/sparc/sparc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 015065f..2dd765b 100644 --- a/gcc/config/sparc/sparc.h

[PATCH 25/30] Changes to s390

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/s390/s390-protos.h: Change movmem to cpymem. * config/s390/s390.c (s390_expand_movmem, s390_expand_setmem, s390_expand_insv): Change movmem to cpymem. * config/s390/s390.md (movmem, movmem_short, *movmem_short, movmem_long, *movm

[PATCH 24/30] Changes to rx

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/rx/rx.md: (UNSPEC_MOVMEM, movmemsi, rx_movmem): Change movmem to cpymem. --- gcc/config/rx/rx.md | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/rx/rx.md b/gcc/config/rx/rx.md index 2790882..9df73e6 100644 --

[PATCH 23/30] Changes to rs6000

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/rs6000/rs6000.md: (movmemsi) Change name to cpymemsi. --- gcc/config/rs6000/rs6000.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index b04c7055..c3087e5 100644 --- a/gcc/config/

[PATCH 22/30] Changes to riscv

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/riscv/riscv.c: Change movmem to cpymem in comment. * config/riscv/riscv.h: Change movmem to cpymem. * config/riscv/riscv.md: (movmemsi) Change name to cpymemsi. --- gcc/config/riscv/riscv.c | 2 +- gcc/config/riscv/riscv.h | 8 gcc/c

[PATCH 21/30] Changes to pdp11

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/pdp11/pdp11.md (movmemhi, movmemhi1, movmemhi_nocc, UNSPEC_MOVMEM): Change movmem to cpymem. --- gcc/config/pdp11/pdp11.md | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/config/pdp11/pdp11.md b/gcc/config/pdp11

[PATCH 20/30] Changes to pa

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/pa/pa.c (compute_movmem_length): Change movmem to cpymem. (pa_adjust_insn_length): Change call to compute_movmem_length. * config/pa/pa.md (movmemsi, movmemsi_prereload, movmemsi_postreload, movmemdi, movmemdi_prereload, movmemdi

[PATCH 19/30] Changes to nds32

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/nds32/nds32-memory-manipulation.c (nds32_expand_movmemsi_loop_unknown_size, nds32_expand_movmemsi_loop_known_size, nds32_expand_movmemsi_loop, nds32_expand_movmemsi_unroll, nds32_expand_movmemsi): Change movmem to cpymem.

[PATCH 18/30] Changes to mips

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/mips/mips.c (mips_use_by_pieces_infrastructure_p): Change movmem to cpymem. * config/mips/mips.h: Change movmem to cpymem. * config/mips/mips.md (movmemsi): Change name to cpymemsi. --- gcc/config/mips/mips.c | 10 +- gcc/confi

[PATCH 17/30] Changes to microblaze

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/microblaze/microblaze.c: Change movmem to cpymem in comment. * config/microblaze/microblaze.md (movmemsi): Change name to cpymemsi. --- gcc/config/microblaze/microblaze.c | 2 +- gcc/config/microblaze/microblaze.md | 2 +- 2 files changed, 2 insertion

[PATCH 16/30] Changes to mcore

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/mcore/mcore.md (movmemsi): Change name to cpymemsi. --- gcc/config/mcore/mcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md index cc84e34..c689351 100644 --- a/gcc/config/mcore/mco

[PATCH 15/30] Changes to m32r

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/m32r/m32r.c (m32r_expand_block_move): Change movmem to cpymem. * config/m32r/m32r.md (movmemsi, movmemsi_internal): Change movmem to cpymem. --- gcc/config/m32r/m32r.c | 4 ++-- gcc/config/m32r/m32r.md | 4 ++-- 2 files changed, 4 insertions(+

[PATCH 01/30] Changes to machine independent code

2019-06-25 Thread acsawdey
From: Aaron Sawdey * builtins.c (get_memory_rtx): Fix comment. * optabs.def (movmem_optab): Change to cpymem_optab. * expr.c (emit_block_move_via_cpymem): Change movmem to cpymem. (emit_block_move_hints): Change movmem to cpymem. * defaults.h: Change movmem

[PATCH 13/30] Changes to lm32

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/lm32/lm32.md (movmemsi): Change name to cpymemsi. --- gcc/config/lm32/lm32.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/lm32/lm32.md b/gcc/config/lm32/lm32.md index c09052c..91a5fe1 100644 --- a/gcc/config/lm32/lm32.md +++

[PATCH 14/30] Changes to m32c

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/m32c/blkmov.md (movmemhi, movmemhi_bhi_op, movmemhi_bpsi_op, movmemhi_whi_op, movmemhi_wpsi_op): Change movmem to cpymem. * config/m32c/m32c-protos.h: Change movmem to cpymem. * config/m32c/m32c.c (m32c_expand_movmemhi): Change movmem to

[PATCH 12/30] Changes to i386

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/i386/i386-expand.c (expand_set_or_movmem_via_loop, expand_set_or_movmem_via_rep, expand_movmem_epilogue, expand_setmem_epilogue_via_loop, expand_set_or_cpymem_prologue, expand_small_cpymem_or_setmem, expand_set_or_cpymem_prologue

[PATCH 10/30] Changes to ft32

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/ft32/ft32.md (movmemsi): Change name to cpymemsi. --- gcc/config/ft32/ft32.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/ft32/ft32.md b/gcc/config/ft32/ft32.md index de23946..9e31f2c 100644 --- a/gcc/config/ft32/ft32.md +++

[PATCH 11/30] Changes to h8300

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/h8300/h8300.md (movmemsi): Change name to cpymemsi. --- gcc/config/h8300/h8300.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index eb0ae83..42610fd 100644 --- a/gcc/config/h8300

[PATCH 09/30] Changes to frv

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/frv/frv.md (movmemsi): Change name to cpymemsi. --- gcc/config/frv/frv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md index 064bf53..6e8db59 100644 --- a/gcc/config/frv/frv.md +++ b/gcc/conf

[PATCH 07/30] Changes to bfin

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/bfin/bfin-protos.h: Change movmem to cpymem. * config/bfin/bfin.c (single_move_for_movmem, bfin_expand_movmem): Change movmem to cpymem. * config/bfin/bfin.h: Change movmem to cpymem in comment. * config/bfin/bfin.md (movmemsi):

[PATCH 08/30] Changes to c6x

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/c6x/c6x-protos.h: Change movmem to cpymem. * config/c6x/c6x.c (c6x_expand_movmem): Change movmem to cpymem. * config/c6x/c6x.md (movmemsi): Change name to cpymemsi. --- gcc/config/c6x/c6x-protos.h | 2 +- gcc/config/c6x/c6x.c| 4 ++-- g

[PATCH 06/30] Changes to avr

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/avr/avr-protos.h: Change movmem to cpymem. * config/avr/avr.c (avr_adjust_insn_length, avr_emit_movmemhi, avr_out_movmem): Change movmem to cpymem. * config/avr/avr.md (movmemhi, movmem_, movmemx_): Change movmem to cpymem. ---

[PATCH 05/30] Changes to arm

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/arm/arm-protos.h: Change movmem to cpymem in names. * config/arm/arm.c (arm_movmemqi_unaligned, arm_gen_movmemqi, gen_movmem_ldrd_strd, thumb_expand_movmemqi) Change movmem to cpymem. * config/arm/arm.md (movmemqi): Change movmem to cpym

[PATCH 04/30] Changes to arc

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/arc/arc-protos.h: Change movmem to cpymem. * config/arc/arc.c (arc_expand_movmem): Change movmem to cpymem. * config/arc/arc.h: Change movmem to cpymem in comment. * config/arc/arc.md (movmemsi): Change movmem to cpymem. --- gcc/config/

[PATCH 03/30] Changes for alpha

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/alpha/alpha.h: Change movmem to cpymem in comment. * config/alpha/alpha.md (movmemqi, movmemdi, *movmemdi_1): Change movmem to cpymem. --- gcc/config/alpha/alpha.h | 2 +- gcc/config/alpha/alpha.md | 6 +++--- 2 files changed, 4 insertions(+),

[PATCH 02/30] Changes for aarch64

2019-06-25 Thread acsawdey
From: Aaron Sawdey * config/aarch64/aarch64-protos.h: Change movmem to cpymem. * config/aarch64/aarch64.c (aarch64_expand_movmem): Change movmem to cpymem. * config/aarch64/aarch64.h: Change movmem to cpymem. * config/aarch64/aarch64.md (movmemdi): Change n

[PATCH 00/30] Rename movmem pattern to cpymem

2019-06-25 Thread acsawdey
From: Aaron Sawdey As we discussed on gcc-list back in mid-May, this is the first set of patches to unscramble things so we can have sensible inline expansion of both memcpy() and memmove(). This patch renames the movmem optab entry and all uses of it to cpymem to reflect the fact that this pat