From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 0B0C238259AE for ; Wed, 31 Aug 2022 15:16:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B0C238259AE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62c.google.com with SMTP id jm11so14394649plb.13 for ; Wed, 31 Aug 2022 08:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=hxEUZk0OQqzahg2OzrMVqLnlm9W9mNHW96imL+6ZFv4=; b=m2JynJCtDBv9qFEtLLyllp5f397ai6fZRyM8yyzjNmVjM7/WdKwKHhbsKzM86jX/W2 1isR/cvYPbXWtxP4Krc700OI5mVIFX/VqXPbBAPDCN50lgPlENxFIiV28qaQvN7qjA28 JuspuK5sWab369RK2Bgs7bsuu8PyBa1jCioAaWxVMDs5kt47kdTWCk+4m8ojhVJjbjjn 1/aXzNR3tNQrlCIQM3hLmYeRzSAt3yxUvDEfFWtRo/ye59CutrxDUum6sSoqMwfBFNBP +yT+yu/NtvamC0qrTcyfAWxYW2eBYuWYdK/S9vsuf+SxJf3NxRbbEAGRDSzX2pW2HjTn 2fWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=hxEUZk0OQqzahg2OzrMVqLnlm9W9mNHW96imL+6ZFv4=; b=q13HdQtMw+9qgb34ZSAWOIxhfDX8zUFCXAxrFNqQOEDbI94iv8PE6i7+CqgciPA/J1 pk+KiRJZwJ1/upUzpl9/apjiUoRYA5qD46kQuoF030g30Pj9c2XQwPfQ2ww88kutWqEE 30FU2WAmR6/nM9Qjqe2NKBmm/YLrH6CXTIyq2EsVoNT7apC/DsYXpzCS6nUd8rQs451D pd2msRYH498V1Quss3HuhAXGLBgrFdUQ52JgdVgSow5Oj6j90dtJANi03Dmzvr6Kn+Li flXSOqpfcp/PzN4bYV2W5DLMCT8nh13SzsYn06fEo0Xb5oaKGp+iNsLHf0RETpLP1Qfb E+ng== X-Gm-Message-State: ACgBeo2afbNuQee561hkZ4wtLM1RzEYNGphf4txFiCHQvFQLM3JGjzu4 qoInQgypXkWbp9FlIoM1ADg9rYkk+RQ= X-Google-Smtp-Source: AA6agR6eW5DB9LDECb9Ji0k01iBk2T57zKXrbsyBygkTsprDornOD5SvEOiot+73wqHCNHh39nDz8A== X-Received: by 2002:a17:90a:9ae:b0:1fd:9357:bb7f with SMTP id 43-20020a17090a09ae00b001fd9357bb7fmr3646856pjo.229.1661958980438; Wed, 31 Aug 2022 08:16:20 -0700 (PDT) Received: from [172.31.0.204] (c-73-98-188-51.hsd1.ut.comcast.net. [73.98.188.51]) by smtp.gmail.com with ESMTPSA id i14-20020aa796ee000000b00537ff911a89sm8682132pfq.105.2022.08.31.08.16.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Aug 2022 08:16:19 -0700 (PDT) Message-ID: <3e39e10b-8f36-b592-f220-6884b5f18b85@gmail.com> Date: Wed, 31 Aug 2022 09:16:18 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH] Add support for floating point endpoints to frange. Content-Language: en-US To: gcc-patches@gcc.gnu.org References: <20220823114224.904934-1-aldyh@redhat.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 List-Id: On 8/29/2022 7:54 AM, Jakub Jelinek via Gcc-patches wrote: > On Mon, Aug 29, 2022 at 03:45:33PM +0200, Aldy Hernandez wrote: >> For convenience, singleton_p() returns false for a NAN. IMO, it makes >> the implementation cleaner, but I'm not wed to the idea if someone >> objects. > If singleton_p() is used to decide whether one can just replace a variable > with singleton range with a constant, then certainly. > If MODE_HAS_SIGNED_ZEROS, zero has 2 representations (-0.0 and 0.0) and > NaNs have lots of different representations (the sign bit is ignored > except for stuff like copysign/signbit, there are qNaNs and sNaNs and > except for the single case how Inf is represented, all other values of the > mantissa mean different representations of NaN). So, unless we track which > exact form of NaN can appear, NaN or any [x, x] range with NaN property > set can't be a singleton. There could be programs that propagate something > important in NaN mantissa and would be upset if frange kills that. > Of course, one needs to take into account that when a FPU creates NaN, it > will create the canonical qNaN. I've always thought of singleton_p as having that purpose -- but in the integer world we never really had to think about multiple representations of the same value.  So it's entirely possible we're using singleton_p for multiple purposes. Clearly if the representation has multiple representations for the same value, then we have to be more careful with propagation.  So we may need to separate the concept of "this has a value we can propagate" from "this has a constant value, but the value may have multiple represenatations". I don't think it's worth trying to track the various NaN representations, but I do think it's worth tracking +-Inf and +-0.0. jeff