From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B3BA13857431; Tue, 28 Jun 2022 21:14:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3BA13857431 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/106117] Use of option -fexcess-precision for operation-by-operation emulation for _Float16 arithmetics. Date: Tue, 28 Jun 2022 21:14:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown 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, 28 Jun 2022 21:14:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106117 --- Comment #2 from joseph at codesourcery dot com --- "none" was something I mentioned as a possible future argument when=20 originally posting -fexcess-precision=20 . I=20 still think it's the appropriate name for that case. (Doing +-*/ operations on float and then immediately converting back to=20 _Float16 has exactly the same semantics as direct _Float16 arithmetic;=20 float has sufficient precision that no double rounding issues arise; that=20 doesn't apply to fma, however. The effect of excess precision is that=20 e.g. in "a + b + c", the value of a + b with the range and precision of=20 float is what gets added to c; there's no intermediate truncation of a + b= =20 to _Float16. But (_Float16)(a + b) + c would have such a truncation,=20 because casts and conversion as if by assignment remove excess range and=20 precision.)=