From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id D71A6388A802 for ; Wed, 10 Jun 2020 07:32:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D71A6388A802 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=richard.sandiford@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8054F1F1; Wed, 10 Jun 2020 00:32:26 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 770FC3F6CF; Wed, 10 Jun 2020 00:32:25 -0700 (PDT) From: Richard Sandiford To: Tamar Christina Mail-Followup-To: Tamar Christina , "gcc-patches\@gcc.gnu.org" , nd , Richard Earnshaw , Marcus Shawcroft , Kyrylo Tkachov , richard.sandiford@arm.com Cc: "gcc-patches\@gcc.gnu.org" , nd , Richard Earnshaw , Marcus Shawcroft , Kyrylo Tkachov Subject: Re: [PATCH] AArch64: Adjust costing of by element MUL to be the same as SAME3 MUL. References: <20200608141406.GA1696@arm.com> <20200609112109.GA15682@arm.com> <20200609122344.GA11277@arm.com> Date: Wed, 10 Jun 2020 08:32:23 +0100 In-Reply-To: <20200609122344.GA11277@arm.com> (Tamar Christina's message of "Tue, 9 Jun 2020 13:23:44 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 10 Jun 2020 07:32:28 -0000 Tamar Christina writes: > @@ -11279,7 +11279,22 @@ aarch64_rtx_mult_cost (rtx x, enum rtx_code code= , int outer, bool speed) > op1 =3D XEXP (x, 1); =20 > if (VECTOR_MODE_P (mode)) > - mode =3D GET_MODE_INNER (mode); > + { > + unsigned int vec_flags =3D aarch64_classify_vector_mode (mode); > + mode =3D GET_MODE_INNER (mode); > + if (vec_flags & VEC_ADVSIMD) > + { > + /* The by element versions of the instruction has the same costs as t= he =E2=80=9Cby-element=E2=80=9D, s/has/have/ > + normal 3 vector version. So don't add the costs of the duplicate = into =E2=80=9C3-vector=E2=80=9D > + the costs of the multiply. We make an assumption that the value in Maybe s/value in/input to/? > + the VEC_DUPLICATE is already the FP&SIMD side. This means costing= of =E2=80=9Calready on the=E2=80=9D Some lines are over the 80-character limit. OK with those changes, thanks. Richard > + a MUL by element pre RA is a bit optimistic. */ > + if (GET_CODE (op0) =3D=3D VEC_DUPLICATE) > + op0 =3D XEXP (op0, 0); > + else if (GET_CODE (op1) =3D=3D VEC_DUPLICATE) > + op1 =3D XEXP (op1, 0); > + } > + } >=20=20 > /* Integer multiply/fma. */ > if (GET_MODE_CLASS (mode) =3D=3D MODE_INT)