From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 68D553858D32 for ; Mon, 18 Sep 2023 17:39:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 68D553858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-CSE-ConnectionGUID: SOsP8VJnROuejakFHurOgA== X-CSE-MsgGUID: dbMPXMZKSsiwqXoEpw4QrQ== X-IronPort-AV: E=Sophos;i="6.02,157,1688457600"; d="scan'208";a="19244484" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 18 Sep 2023 09:39:58 -0800 IronPort-SDR: yJ2ROQr4JNWZpi8QucUsCgMTnF3cOWkzb9KinXz9KF+OCSv+Qk7wM/FluIdSv8dVDJlP5/NAqp BICb4cF0dIRyKJ7t2FOEbRIlbFXnID2ArdtxLbtqyJt9X0qEFsYef7l3r7qw/WmHYrQT3N2hUq Xo81EPzLUUaMyNUlhzSlODIxXRh/TPcvQ0uYHpVejLyD+l6tsm3Sgy4oTsWAWQ+4pbaRHmU7XY 57ruUTj3Wr3AHXoDE4rcPfL1CnwYS/8JZhSegWksrY1XnoCFfUjzhOV6gnMvJmc8UUL1Uj1I+p +jA= Date: Mon, 18 Sep 2023 17:39:54 +0000 From: Joseph Myers To: Alexander Monakov CC: Florian Weimer , Subject: Re: Concerns regarding the -ffp-contract=fast default In-Reply-To: <19d3396f-4b7a-6e44-1f31-e95dbd1176dc@ispras.ru> Message-ID: References: <87r0n01z18.fsf@oldenburg3.str.redhat.com> <21e46cef-1fbf-df87-608d-52b7f894dea7@ispras.ru> <877condc69.fsf@oldenburg.str.redhat.com> <87y1h3btqm.fsf@oldenburg.str.redhat.com> <87o7hzbfho.fsf@oldenburg.str.redhat.com> <19d3396f-4b7a-6e44-1f31-e95dbd1176dc@ispras.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1152306461-483706394-1695058794=:3285446" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3104.3 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: ---1152306461-483706394-1695058794=:3285446 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT On Mon, 18 Sep 2023, Alexander Monakov wrote: > > On Mon, 18 Sep 2023, Florian Weimer wrote: > > > Okay, you meant “changing the result” as in “changing the result in a > > permitted way”. Sorry, was confused. So this is a bad example all > > around. Are there better ones (that don't involve FMA)? > > If you're looking for something similar to your original example, I can > suggest 'x + x + x + x' -> '4 * x' under -frounding-math (i.e. not assuming > default rounding mode) or 'x + x + x + x + x + x' -> '6 * x' for default > rounding. > > I don't have a "somewhat practical" example off-hand, since apart from FMA > fused operations are rarely available in instruction sets. Apart from FMA, there are the formatOf operations such as fadd (add two doubles, rounding the result just once to float). Fewer instruction sets have those than have FMA, however (ia64 did; newer versions of Power support such operations as well to some extent, though with limitations when underflow or overflow occur). -- Joseph S. Myers joseph@codesourcery.com ---1152306461-483706394-1695058794=:3285446--