Fix earlier commit missing patch review changes

Somehow I lost my fixes based on Segher's review of the p10
logical-logical fusion patch. This commit adds the changes that
should have been there before. Bootstrap/regtest passed.

gcc/ChangeLog:

	* config/rs6000/genfusion.pl (gen_2logical): Add missing
	fixes based on patch review.
	* config/rs6000/fusion.md: Regenerate file.
This commit is contained in:
Aaron Sawdey 2021-02-02 19:40:56 -06:00
parent 05c93a63a6
commit 74f2ae3f1f
2 changed files with 1033 additions and 904 deletions

File diff suppressed because it is too large Load Diff

View File

@ -192,7 +192,8 @@ sub gen_2logical
if ( ($inner_comp & 2) == 2 ) {
$inner_arg1 = "(not:${mode} $inner_arg1)";
}
$inner_exp = "(${inner_rtl}:${mode} ${inner_arg0} ${inner_arg1})";
$inner_exp = "(${inner_rtl}:${mode} ${inner_arg0}
${inner_arg1})";
if ( $inner_inv == 1 ) {
$inner_exp = "(not:${mode} $inner_exp)";
}
@ -203,7 +204,8 @@ sub gen_2logical
if ( ($outer_comp & 2) == 2 ) {
$inner_exp = "(not:${mode} $inner_exp)";
}
$outer_exp = "(${outer_rtl}:${mode} ${inner_exp} ${outer_arg2})";
$outer_exp = "(${outer_rtl}:${mode} ${inner_exp}
${outer_arg2})";
if ( $outer_inv == 1 ) {
$outer_exp = "(not:${mode} $outer_exp)";
}
@ -211,17 +213,16 @@ sub gen_2logical
$insn = <<"EOF";
;; logical-logical fusion pattern generated by gen_2logical
;; kind: $kind outer: $outer op $outer_op rtl $outer_rtl inv $outer_inv comp $outer_comp
;; inner: $inner op $inner_op rtl $inner_rtl inv $inner_inv comp $inner_comp
;; $kind $inner_op -> $outer_op
(define_insn "*fuse_${inner_op}_${outer_op}"
[(set (match_operand:${mode} 3 "${pred}" "=&${constraint},0,1,${constraint}")
[(set (match_operand:${mode} 3 "${pred}" "=0,1,&${constraint},${constraint}")
${outer_exp})
(clobber (match_scratch:${mode} 4 "=X,X,X,r"))]
(clobber (match_scratch:${mode} 4 "=X,X,X,&r"))]
"(TARGET_P10_FUSION && TARGET_P10_FUSION_2LOGICAL)"
"@
${inner_op} %3,%1,%0\\;${outer_op} %3,%3,%2
${inner_op} %0,%1,%0\\;${outer_op} %0,%0,%2
${inner_op} %1,%1,%0\\;${outer_op} %1,%1,%2
${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 "cost" "6")