From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 8825E3858D37 for ; Mon, 17 Aug 2020 22:31:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8825E3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: 57kYT11ukFu4js77EFR2CaLqZmxf1gWR/DkH9wG6PJE1TOA6MXD3UIF+N7Yk9081mz6uN2VRsA bSyK2R8lRmQN6SKy4Jf3IIw5K6po67BsppPWz99+D6DLpCSOpzATZAgaSZqXnVU+wQo1Jgy3R8 1RtrNeOmwfPUrrNd7/lK7B6FgdcQL5Ug1jJEWCTBo9s1wvP/YONoAuD7ejB+TzvylCZcklws6r SFdc1rPD41JXCj7h+eab5DpeiH27cBRdXsp1pywZh7wgL/lBvj2zeUTos20PcbC7+OsvCuKzHB ikc= X-IronPort-AV: E=Sophos;i="5.76,324,1592899200"; d="scan'208";a="52118704" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 17 Aug 2020 14:31:13 -0800 IronPort-SDR: iOpsHJD3GTeTUFIm7LZCS9Lb91TDKLC6kr0bHjWdYsW4Zq1/BkntmaNq8fjj+EWAMYpb18NhIu 0BbSlUYO1pfdhSDlCn080KcAInHRsa49qPcgmQ02JoqE5xLpxPSlRGkmD3L5+xaHdGxWYGkgRz TcJiwNfxJJWlC1HVCuyrwf/10QyKVIys/ftSV38vVS3JZ1AHHJqppDEY5sD46/tWtfsPIjR25r 1HNk/B3q6a+UKjgU+eqLY/BXYKUi1Hml+EeDHCxDQx1zL75zisgXLGe0QBg/vdQAB+dn1/crQE Wlk= Date: Mon, 17 Aug 2020 22:31:08 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Segher Boessenkool CC: Roger Sayle , 'GCC Patches' Subject: Re: [PATCH] middle-end: Fix PR middle-end/85811: Introduce tree_expr_maybe_nan_p et al. In-Reply-To: <20200816011643.GU6753@gate.crashing.org> Message-ID: References: <004901d672f4$b80b66f0$282234d0$@nextmovesoftware.com> <20200816011643.GU6753@gate.crashing.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-Spam-Status: No, score=-3127.9 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.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: Mon, 17 Aug 2020 22:31:16 -0000 On Sat, 15 Aug 2020, Segher Boessenkool wrote: > Hi! > > On Sat, Aug 15, 2020 at 12:10:42PM +0100, Roger Sayle wrote: > > I'll quote Joseph Myers (many thanks) who describes things clearly as: > > > (a) When both arguments are NaNs, the return value should be a qNaN, > > > but sometimes it is an sNaN if at least one argument is an sNaN. > > Where is this defined? I can't find it in C11, in 18661, and of course > it isn't what GCC does (it requires -fsignaling to even acknowledge the > existence of signaling NaNs :-) ) The semantics of fmax and fmin are those of the maxNum and minNum operations in IEEE 754-2008 (that were removed in IEEE 754-2019); see the table of IEEE operation bindings that 18661-1 adds to Annex F. minNum(x, y) is the canonicalized number x if x < y, y if y < x, the canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it is either x or y, canonicalized (this means results might differ among implementations). When either x or y is a signalingNaN, then the result is according to 6.2. maxNum(x, y) is the canonicalized number y if x < y, x if y < x, the canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it is either x or y, canonicalized (this means results might differ among implementations). When either x or y is a signalingNaN, then the result is according to 6.2. where the relevant wording from 6.2 is Under default exception handling, any operation signaling an invalid operation exception and for which a floating-point result is to be delivered shall deliver a quiet NaN. Signaling NaNs shall be reserved operands that, under default exception handling, signal the invalid operation exception (see 7.2) for every general-computational and signaling-computational operation except for the conversions described in 5.12. For non-default treatment, see 8. (and maxNum and minNum are in 5.3 "Homogeneous general-computational operations"). -- Joseph S. Myers joseph@codesourcery.com