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 684143858C20 for ; Mon, 29 Aug 2022 14:20:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 684143858C20 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=1661782829; 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=VSgARaLwCqTOuJLYj5lk6qKSw5lgPwq2lg0wAFD6p0s=; b=K3OZkZ2cEwCs7FS1M62I2i1RhYSlb7ZenfmD6IT545SSUEMiCIaOzfqIgX/fm/55EhCNY5 N82M6AmZcSpRMVYp7bjXER2jaz98mqJyX9rXEPnQaiz0ZMBm5GKBAYOjxIeyvfwK8UJ66l B8jrQQSjOmZIzC/aOl21efsWbkoOszo= Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-441-FfSCtivKNvq05ZxQ-78j8g-1; Mon, 29 Aug 2022 10:20:28 -0400 X-MC-Unique: FfSCtivKNvq05ZxQ-78j8g-1 Received: by mail-oi1-f200.google.com with SMTP id q4-20020a0568080ec400b00342b973d2e3so2616252oiv.11 for ; Mon, 29 Aug 2022 07:20:28 -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=VSgARaLwCqTOuJLYj5lk6qKSw5lgPwq2lg0wAFD6p0s=; b=KGco4z/B8XqBl3oYuxOe5RQB3aX9J1wcu1UNt5MRskyJkRyWn3UZJ9ynef0COQHKQm umpJzcTELWumt7tJbjsGhN0zsINvuH3RMqPsQV2iAPEI9PuGTc2y3TbTLLz+PSc8GED+ 4Roy36zpOiNiIxRCk4gUpLf+sHyppjXPeodwzmYcug6I7GwINfOCcZGH2Ic6kRXDitD+ UQaZAP9Y55W1EIA7tFg5rzuS9owXuMxY7q4QTp1DRb+kyF11iofX+lPt3uBbaiL3RUlG GKzOn32RnvMf6wBQ2XmfsnfinzXTLOOMbVSAu0ejTFl4hSJpWYaunZRuuRELCsix6Gp/ wBkg== X-Gm-Message-State: ACgBeo2ZiySiCkUATREQiaZhW3ewKLRXFMhov43GqeFkzmn6jFJDowkQ 02joDzIfQ7zZuzVMR7od+5KAbr0wXYYCLczfsUOJ2cpNr8Wu3sbRyBXmkMiPPqF4rYU+OQK4mPf OqafkZhsIkI2E3Gx0XEJpxjEb2aMhxiC0eg== X-Received: by 2002:a05:6830:12d5:b0:638:e048:ef97 with SMTP id a21-20020a05683012d500b00638e048ef97mr6703351otq.276.1661782827949; Mon, 29 Aug 2022 07:20:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR5z7thX7uMQvKUKLDLBZhIiJO2MPUXxsLVVH8SsptehRE/LlIJXQzV1Whc0aImOVfyyNSQ81m7XtjeycQSNXo0= X-Received: by 2002:a05:6830:12d5:b0:638:e048:ef97 with SMTP id a21-20020a05683012d500b00638e048ef97mr6703342otq.276.1661782827742; Mon, 29 Aug 2022 07:20:27 -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:20:16 +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=-6.0 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 4:17 PM Jakub Jelinek wrote: > > On Mon, Aug 29, 2022 at 04:08:58PM +0200, Aldy Hernandez wrote: > > 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; > > Perhaps if (HONOR_NANS (m_type) && !get_nan ().no_p ()) instead? > Or do you ensure the nan property is never set for -ffinite-math-only? See followup with Tom downthread. Sure, I can add the HONOR_NANS, but can we even "see" a NAN in the IL for -ffinite-math-only? I suppose it's cleaner with HONOR_NANS.... Aldy