From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1E4A43858C54; Tue, 26 Apr 2022 18:46:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E4A43858C54 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103605] [PowerPC] fmin/fmax should be inlined always with xsmindp/xsmaxdp Date: Tue, 26 Apr 2022 18:46:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2022 18:46:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103605 --- Comment #4 from joseph at codesourcery dot com --- On Tue, 26 Apr 2022, guihaoc at gcc dot gnu.org via Gcc-bugs wrote: > C99/11 standard > If just one argument is a NaN, the fmin functions return the other argume= nt (if > both arguments are NaNs, the functions return a NaN). > fmin(NaN, 3.0) =3D fmin(3.0, NaN) =3D 3.0 "NaN" here means quiet NaN. > xsmindp > The minimum of a QNaN and any value is that value. The minimum of any val= ue and > an SNaN is that SNaN converted to a QNaN. > xsmindp(NaN, 3.0) =3D 3.0 xsmindp(3.0, NaN) =3D NaN That seems right for fmin, provided that (QNaN, SNaN) arguments in either=20 order produce a QNaN result (with "invalid" raised). Note that fmin and=20 fmax follow the old operations from IEEE 754-2008 (that aren't associative= =20 in the presence of SNaN), not any of the new operations from IEEE=20 754-2019.=