From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id DB09B3858C50 for ; Mon, 28 Mar 2022 22:07:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB09B3858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 22SM61ts004626; Mon, 28 Mar 2022 17:06:01 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 22SM60VT004623; Mon, 28 Mar 2022 17:06:00 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 28 Mar 2022 17:06:00 -0500 From: Segher Boessenkool To: Michael Meissner , gcc-patches@gcc.gnu.org, David Edelsohn , Peter Bergner , Will Schmidt Subject: Re: [PATCH 3/4] Make vsx_extract_ use correct insn attributes, PR target 99293. Message-ID: <20220328220600.GO614@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2022 22:07:04 -0000 Hi! On Mon, Mar 28, 2022 at 12:28:04PM -0400, Michael Meissner wrote: > In looking at PR target/99293, I noticed that the insn "type" attribute is > incorrect for the vsx_extract_ insns. In particular: > > 1) Simple vector register move should be vecmove (alternative 1); > 2) Xxpermdi should be vecperm (alternative 2); (and) > 3) Mfvsrld should be mfvsr (alternative 4). > > This patch fixes those attributes. But the code does not correspond well to the alternatives, even worse for BE. It would be much clearer (and even possibly correct!) if it would just use the alternative # in the code, instead of using twenty different conditions. There are some important cases that have no alternative right now, like, when op 1 is the same as op 0: it should have the constraint "0" for op 1 then, and have cost 0. The register allocator will then hopefully try to make that happen. > --- a/gcc/config/rs6000/vsx.md > +++ b/gcc/config/rs6000/vsx.md > @@ -3451,7 +3451,7 @@ (define_insn "vsx_extract_" > else > gcc_unreachable (); > } > - [(set_attr "type" "veclogical,mfvsr,mfvsr,vecperm") > + [(set_attr "type" "vecmove,vecperm,mfvsr,mfvsr") > (set_attr "isa" "*,*,p8v,p9v")]) The generated code is one of no-op mfvsrd fmr xxlor mfvsrld xxpermdi Which of the 4 alts are meant to correspond to which of those six possible generated pieces of code? Segher