On Mon, 2021-04-26 at 13:04 -0500, acsaw...@linux.ibm.com wrote:
> From: Aaron Sawdey <acsaw...@linux.ibm.com>
> 
> 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 genfusion.pl.
> 
> If bootstrap/regtest passes, OK for trunk and backport to 11.2?
> 
> Thanks,
>     Aaron
> 
Hi,


> gcc/
>       * rs6000.md (define_attr "type"): Add types for fusion.
>       * genfusion.md (gen_ld_cmpi_p10): Use new fusion types.
>       (gen_2logical): Use new fusion types.
>       * fusion.md: Regenerate.

Should the new types be listed here?


> ---
>  gcc/config/rs6000/fusion.md    | 288 ++++++++++++++++---------------
> --
>  gcc/config/rs6000/genfusion.pl |   8 +-
>  gcc/config/rs6000/rs6000.md    |   4 +-
>  3 files changed, 152 insertions(+), 148 deletions(-)
> 


> diff --git a/gcc/config/rs6000/rs6000.md
> b/gcc/config/rs6000/rs6000.md
> index c8cdc42533c..801e1014267 100644
> --- a/gcc/config/rs6000/rs6000.md
> +++ b/gcc/config/rs6000/rs6000.md
> @@ -204,7 +204,9 @@ (define_attr "type"
>     vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,
>     vecfloat,vecfdiv,vecdouble,mtvsr,mfvsr,crypto,
>     veclogical,veccmpfx,vecexts,vecmove,
> -   htm,htmsimple,dfp,mma"
> +   htm,htmsimple,dfp,mma,
> +   fused_arith_logical,fused_cmp_isel,fused_carry,fused_load_cmpi,
> +   fused_load_load,fused_store_store,fused_addis_load,fused_mtbc,fus
> ed_vector"


A few of these new attributes appear unused in this patch.  
Should those be dropped, or will they be used later? 


> diff --git a/gcc/config/rs6000/fusion.md
> b/gcc/config/rs6000/fusion.md
> index 56478fcae1d..6d71bc2df73 100644
> --- a/gcc/config/rs6000/fusion.md
> +++ b/gcc/config/rs6000/fusion.md

<snip>

> @@ -1503,7 +1503,7 @@ (define_insn "*fuse_xor_xor"
>     xor %3,%1,%0\;xor %3,%3,%2
>     xor %3,%1,%0\;xor %3,%3,%2
>     xor %4,%1,%0\;xor %3,%4,%2"
> -  [(set_attr "type" "logical")
> +  [(set_attr "type" "fused_arith_logical")
>     (set_attr "cost" "6")
>     (set_attr "length" "8")])
> 
> @@ -1521,7 +1521,7 @@ (define_insn "*fuse_vand_vand"
>     vand %3,%1,%0\;vand %3,%3,%2
>     vand %3,%1,%0\;vand %3,%3,%2
>     vand %4,%1,%0\;vand %3,%4,%2"
> -  [(set_attr "type" "logical")
> +  [(set_attr "type" "fused_vector")
>     (set_attr "cost" "6")
>     (set_attr "length" "8")])


Noting that the vector-logicals are lumped into the fused_vector versus
logical..   I assume this is correct.  :-)


<snip>

diff --git a/gcc/config/rs6000/genfusion.pl
> b/gcc/config/rs6000/genfusion.pl
> index c86c7436a62..ce48fd94f95 100755
> --- a/gcc/config/rs6000/genfusion.pl
> +++ b/gcc/config/rs6000/genfusion.pl
> @@ -135,7 +135,7 @@ sub gen_ld_cmpi_p10
>         print "   (set (match_dup 2)\n";
>         print "        (compare:${ccmode} (match_dup 0) (match_dup
> 3)))]\n";
>         print "  \"\"\n";
> -       print "  [(set_attr \"type\" \"load\")\n";
> +       print "  [(set_attr \"type\" \"fused_load_cmpi\")\n";
>         print "   (set_attr \"cost\" \"8\")\n";
>         print "   (set_attr \"length\" \"8\")])\n";
>         print "\n";
> @@ -159,18 +159,20 @@ sub gen_2logical
>      my ($kind, $vchr, $mode, $pred, $constraint, $cr, $outer,
> $outer_op,
>       $outer_comp, $outer_inv, $outer_rtl, $inner, $inner_comp,
> $inner_inv,
>       $inner_rtl, $inner_op, $both_commute, $c4, $bc, $inner_arg0,
> -     $inner_arg1, $inner_exp, $outer_arg2, $outer_exp, $insn);
> +     $inner_arg1, $inner_exp, $outer_arg2, $outer_exp, $insn,
> $fuse_type);
>    KIND: foreach $kind ('scalar','vector') {
>        if ( $kind eq 'vector' ) {
>         $vchr = "v";
>         $mode = "VM";
>         $pred = "altivec_register_operand";
>         $constraint = "v";
> +       $fuse_type = "fused_vector";
>        } else {
>         $vchr = "";
>         $mode = "GPR";
>         $pred = "gpc_reg_operand";
>         $constraint = "r";
> +       $fuse_type = "fused_arith_logical";
>        }
>        $c4 =
> "${constraint},${constraint},${constraint},${constraint}";
>      OUTER: foreach $outer ( @logicals ) {
> @@ -227,7 +229,7 @@ sub gen_2logical
>     ${inner_op} %3,%1,%0\\;${outer_op} %3,%3,%2
>     ${inner_op} %3,%1,%0\\;${outer_op} %3,%3,%2
>     ${inner_op} %4,%1,%0\\;${outer_op} %3,%4,%2"
> -  [(set_attr "type" "logical")
> +  [(set_attr "type" "$fuse_type")
>     (set_attr "cost" "6")
>     (set_attr "length" "8")])


ok

thanks
-Will

>  EOF
> 

Reply via email to