From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 8063E385829B; Tue, 9 Apr 2024 04:31:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8063E385829B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712637080; bh=zaskmXdieKJxhjBpKOA5kQltazbJhwsu4G2k3puLX5Q=; h=From:To:Subject:Date:From; b=RhDMxY9XvAzClL68JabDpNPIRmrW7S2AE3nW7xg2RDkpFc83xJNVA8m7FG/OOv1gK iQAmnnFLT9nf9hQVGg5ap2fsP3lar8EvD3RGFvnjE6k7b5IiXK7ptnGJitOHo7veXG NnFV/VD/AMn3omGat5O0P1glAyLAsMvk2sltg5OA= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work164-bugs)] Add power10 ori/oris and xori/xoris fusion support. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work164-bugs X-Git-Oldrev: 36b37616daeec9f84d6afa97a6e2d235bebe103d X-Git-Newrev: 9b813c320ee59176e3279391ef7c47ef6ea8ba3a Message-Id: <20240409043120.8063E385829B@sourceware.org> Date: Tue, 9 Apr 2024 04:31:20 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9b813c320ee59176e3279391ef7c47ef6ea8ba3a commit 9b813c320ee59176e3279391ef7c47ef6ea8ba3a Author: Michael Meissner Date: Tue Apr 9 00:30:46 2024 -0400 Add power10 ori/oris and xori/xoris fusion support. 2024-04-09 Michael Meissner gcc/ * config/rs6000/fusion.md: Regenerate. * config/rs6000/genfusion.md (gen_wide_immediate): Add wide immediate fusion patterns. * config/rs6000/rs6000.md (IORXOR_OP): New code attribute. (ior, xor splitter): Do not split ior/xor patterns that could be fused on power10. Diff: --- gcc/config/rs6000/fusion.md | 10 ++++++++++ gcc/config/rs6000/genfusion.pl | 17 +++++++++++++++++ gcc/config/rs6000/rs6000.md | 5 ++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/fusion.md b/gcc/config/rs6000/fusion.md index 4ed9ae1d69f..45819627df6 100644 --- a/gcc/config/rs6000/fusion.md +++ b/gcc/config/rs6000/fusion.md @@ -3055,3 +3055,13 @@ [(set_attr "type" "fused_vector") (set_attr "cost" "6") (set_attr "length" "8")]) + +;; ori_oris and xori_xoris fusion patterns generated by gen_wide_immediate +(define_insn "*fuse_i_is" + [(set (match_operand:DI 0 "gpc_reg_operand" "=&r") + (iorxor:DI + (match_operand:DI 1 "gpc_reg_operand" "r") + (match_operand:DI 2 "non_logical_cint_operand" "n")))] + "(TARGET_P10_FUSION)" + "i %0,%1,%w2\;is %0,%0,%v2" + [(set_attr "length" "8")]) diff --git a/gcc/config/rs6000/genfusion.pl b/gcc/config/rs6000/genfusion.pl index 2271be14bfa..d059de8afc9 100755 --- a/gcc/config/rs6000/genfusion.pl +++ b/gcc/config/rs6000/genfusion.pl @@ -367,6 +367,23 @@ EOF } } +sub gen_wide_immediate +{ + print <<"EOF"; + +;; ori_oris and xori_xoris fusion patterns generated by gen_wide_immediate +(define_insn "*fuse_i_is" + [(set (match_operand:DI 0 "gpc_reg_operand" "=&r") + (iorxor:DI + (match_operand:DI 1 "gpc_reg_operand" "r") + (match_operand:DI 2 "non_logical_cint_operand" "n")))] + "(TARGET_P10_FUSION)" + "i %0,%1,%w2\\;is %0,%0,%v2" + [(set_attr "length" "8")]) +EOF +} + gen_ld_cmpi_p10(); gen_logical_addsubf(); gen_addadd; +gen_wide_immediate(); diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 1acd34ca0ee..f626b68ebb2 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -822,6 +822,9 @@ (SF "TARGET_P8_VECTOR") (DI "TARGET_POWERPC64")]) +;; Convert iorxor iterator into or/xor instruction +(define_code_attr IORXOR_OP [(ior "or") (xor "xor")]) + (include "darwin.md") ;; Start with fixed-point load and store insns. Here we put only the more @@ -3933,7 +3936,7 @@ [(set (match_operand:GPR 0 "gpc_reg_operand") (iorxor:GPR (match_operand:GPR 1 "gpc_reg_operand") (match_operand:GPR 2 "non_logical_cint_operand")))] - "" + "mode != DImode || !TARGET_P10_FUSION" [(set (match_dup 3) (iorxor:GPR (match_dup 1) (match_dup 4)))