From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AE38B3858D37 for ; Mon, 29 Aug 2022 14:09:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE38B3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661782151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=z7ILL6/TWjXE8q7iNzrwkqavFhHqMPXR36PNcjd41bQ=; b=Wm90ckB173YpdrXYd+/wh9kwjJ73v1nDGwvaNVpk1zka3fnfyaEaWQn4qLGgnOhWx4Hn8F gRCBeN0XiPQdBBTBALIfTHWhFGFupqSRPu1Jd61beDqeoByNU29F4EbMTKH8FtUZiRL0Dk z/pkK3Zz805xHjuT6xpTwoYacWA3QsM= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-457-_rbMkMOVMReHoJ--_nl6OA-1; Mon, 29 Aug 2022 10:09:10 -0400 X-MC-Unique: _rbMkMOVMReHoJ--_nl6OA-1 Received: by mail-oo1-f70.google.com with SMTP id x25-20020a4a3959000000b0044896829889so3704518oog.17 for ; Mon, 29 Aug 2022 07:09:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=z7ILL6/TWjXE8q7iNzrwkqavFhHqMPXR36PNcjd41bQ=; b=T/cQDrSmnU8U4wOTSf8T3TS0jJo9tc73VA/OhIdS5o0Xq+S3wH/x2ji0LjFSXOyYOT IOgZihfExyUD7+ZsOOoqiv/SoB1DnjgCL2hLl3SShmetpeQdOU5sYsF3U2TLOd7eJTCF 0hYfCuehI9AxiKZTa9fY46RI4miWJ/xjJ6FpynStgIMbvyH39VtX3vjJyHpzOGxZcS+Z pHpLQVFyueQps0jXKBJvd+1GwDNKu1k2NDRevYlCvLv+QCffvjQiHEYe+wDqf5is1/Hf TpDsTfBjrtPBs2y5vPhl419yNEGco9gfryzDpPs6S/+g0GgXjMiuFtlaCZuqTDSf7auT S6ug== X-Gm-Message-State: ACgBeo2cF4VLvG31olzbUrSDkZ6yD66UmgzMyC6dz2Qlhze75ZSnkAtG qed9Bd7sGLGbSfpOfYlstVJ8zPc3o0VUQs/EVUNV4MSg0J1/Rg4fLydQ334JHTChm3miTaOQRiB sISntms9s5/MYogsrFq2ndw0hn9j3qcShjQ== X-Received: by 2002:a05:6808:f07:b0:344:7739:8e7b with SMTP id m7-20020a0568080f0700b0034477398e7bmr7406459oiw.265.1661782149792; Mon, 29 Aug 2022 07:09:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR6RlGKqxwdNlNeS6Ce+qD5mJxvU/2KQI2ln1xLNURCwISc4cTtxqe4R2+x3pAbIlm0uz1b3oPjRtD6Spu399a8= X-Received: by 2002:a05:6808:f07:b0:344:7739:8e7b with SMTP id m7-20020a0568080f0700b0034477398e7bmr7406445oiw.265.1661782149470; Mon, 29 Aug 2022 07:09:09 -0700 (PDT) MIME-Version: 1.0 References: <20220823114224.904934-1-aldyh@redhat.com> In-Reply-To: From: Aldy Hernandez Date: Mon, 29 Aug 2022 16:08:58 +0200 Message-ID: Subject: Re: [PATCH] Add support for floating point endpoints to frange. To: Jakub Jelinek Cc: GCC patches , Andrew MacLeod , Andrew Pinski X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,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 Mon, Aug 29, 2022 at 3:55 PM Jakub Jelinek 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 Ok that was more or less what I was thinking. And no, we don't keep track of the type of NANs. How does this look? bool frange::singleton_p (tree *result) const { if (m_kind == VR_RANGE && real_identical (&m_min, &m_max)) { // If we're honoring signed zeros, fail because we don't know // which zero we have. This avoids propagating the wrong zero. if (HONOR_SIGNED_ZEROS (m_type) && zero_p ()) return false; // Return false for any singleton that may be a NAN. if (!get_nan ().no_p ()) return false; if (result) *result = build_real (m_type, m_min); return true; } return false; } Thanks. Aldy > 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. > > Jakub >