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 1ACAB385843E for ; Fri, 13 May 2022 16:35:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1ACAB385843E 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 B646C113E; Fri, 13 May 2022 09:35:07 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2D1D33F73D; Fri, 13 May 2022 09:35:07 -0700 (PDT) From: Richard Sandiford To: Christophe Lyon via Gcc-patches Mail-Followup-To: Christophe Lyon via Gcc-patches , Christophe Lyon , richard.sandiford@arm.com Subject: Re: [PATCH v2 02/10] aarch64: Add backend support for DFP References: <20220509143507.239804-3-christophe.lyon@arm.com> <20220513160827.303091-1-christophe.lyon@arm.com> Date: Fri, 13 May 2022 17:35:05 +0100 In-Reply-To: <20220513160827.303091-1-christophe.lyon@arm.com> (Christophe Lyon via Gcc-patches's message of "Fri, 13 May 2022 18:08:27 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Fri, 13 May 2022 16:35:09 -0000 Christophe Lyon via Gcc-patches writes: > @@ -19352,7 +19363,9 @@ aarch64_legitimate_constant_p (machine_mode mode,= rtx x) > { > /* Support CSE and rematerialization of common constants. */ > if (CONST_INT_P (x) > - || (CONST_DOUBLE_P (x) && GET_MODE_CLASS (mode) =3D=3D MODE_FLOAT)) > + || (CONST_DOUBLE_P (x) > + && (GET_MODE_CLASS (mode) =3D=3D MODE_FLOAT > + || GET_MODE_CLASS (mode) =3D=3D MODE_DECIMAL_FLOAT))) > return true; >=20=20 > /* Only accept variable-length vector constants if they can be I'd prefer to remove the mode check here, rather than extend it. If we see a CONST_DOUBLE that doesn't have a scalar float mode then something has gone wrong. (No need to assert for that though. It's a fundamental assumption when TARGET_SUPPORTS_WIDE_INT.) For consistency=E2=80=A6 > @@ -11114,11 +11116,16 @@ aarch64_float_const_rtx_p (rtx x) > return false; > } >=20=20 > -/* Return TRUE if rtx X is immediate constant 0.0 */ > +/* Return TRUE if rtx X is immediate constant 0.0 (but not in Decimal > + Floating Point). */ > bool > aarch64_float_const_zero_rtx_p (rtx x) > { > - if (GET_MODE (x) =3D=3D VOIDmode) > + if (GET_MODE (x) =3D=3D VOIDmode > + /* 0.0 in Decimal Floating Point cannot be represented by #0 or > + zr as our callers expect, so no need to check the actual > + value if X is of Decimal Floating Point type. */ > + || GET_MODE_CLASS (GET_MODE (x)) =3D=3D MODE_DECIMAL_FLOAT) =E2=80=A6it would be good to drop the VOIDmode check here at the same time. OK with those changes, thanks. Richard