From patchwork Wed Aug 31 12:38:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1672314 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=AGaGfBWm; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MHkJK1Qpdz1yhQ for ; Wed, 31 Aug 2022 22:39:13 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 210053857350 for ; Wed, 31 Aug 2022 12:39:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 210053857350 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661949551; bh=iW4+fgXuFX0ea2/ZTnF7ZIfR5/pcBw5fql1YFrBLqvE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=AGaGfBWmClN6epFNgElrHr4uP97LZQ99vWymFgT8NWAAnOGD5itGjl9+afcrRp7Kq vtR32HZNOf9L3YS+zmmTApNZ6I3t4LnJOqrWGqR8cKTOO7dq4WyAxT53i+TxGO9XdF vpf2lPNrXfc09UZehubU4h2Igao8JsTD3sMGHb60= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 ED2F038582A7 for ; Wed, 31 Aug 2022 12:38:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED2F038582A7 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-281-QVDCtEQIPQ2P1PHWM_A-VA-1; Wed, 31 Aug 2022 08:38:48 -0400 X-MC-Unique: QVDCtEQIPQ2P1PHWM_A-VA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2892C3810792 for ; Wed, 31 Aug 2022 12:38:48 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C511BC15BB3; Wed, 31 Aug 2022 12:38:47 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 27VCcj7w2389600 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 31 Aug 2022 14:38:45 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 27VCcicu2389599; Wed, 31 Aug 2022 14:38:44 +0200 To: GCC patches Subject: [COMMITTED] Stream out endpoints for frange. Date: Wed, 31 Aug 2022 14:38:40 +0200 Message-Id: <20220831123840.2389555-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 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-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" We only stream out the FP properties for global float ranges (currently only NAN). The following patch adds the endpoints as well. gcc/ChangeLog: * value-range-storage.cc (frange_storage_slot::set_frange): Save endpoints. (frange_storage_slot::get_frange): Restore endpoints. * value-range-storage.h (class frange_storage_slot): Add endpoint fields. --- gcc/value-range-storage.cc | 18 +++++++----------- gcc/value-range-storage.h | 8 +++++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/gcc/value-range-storage.cc b/gcc/value-range-storage.cc index 494392737ac..b7a23fa9825 100644 --- a/gcc/value-range-storage.cc +++ b/gcc/value-range-storage.cc @@ -253,6 +253,8 @@ frange_storage_slot::set_frange (const frange &r) gcc_checking_assert (fits_p (r)); gcc_checking_assert (!r.undefined_p ()); + m_min = r.m_min; + m_max = r.m_max; m_props = r.m_props; } @@ -261,18 +263,12 @@ frange_storage_slot::get_frange (frange &r, tree type) const { gcc_checking_assert (r.supports_type_p (type)); - // FIXME: NANs get special treatment, because we need [NAN, NAN] in - // the range to properly represent it, not just the NAN flag in the - // property bits. This will go away when we stream out the - // endpoints. - if (m_props.get_nan ().yes_p ()) - { - r = frange_nan (type); - return; - } - - r.set_varying (type); + r.set_undefined (); + r.m_kind = VR_RANGE; r.m_props = m_props; + r.m_type = type; + r.m_min = m_min; + r.m_max = m_max; r.normalize_kind (); if (flag_checking) diff --git a/gcc/value-range-storage.h b/gcc/value-range-storage.h index 9cd6b9f7bec..f506789f3d1 100644 --- a/gcc/value-range-storage.h +++ b/gcc/value-range-storage.h @@ -113,9 +113,11 @@ class GTY (()) frange_storage_slot frange_storage_slot (const frange &r) { set_frange (r); } DISABLE_COPY_AND_ASSIGN (frange_storage_slot); - // We can get away with just storing the properties because the type - // can be gotten from the SSA, and UNDEFINED is unsupported, so it - // can only be a range. + // We can get away with just storing the properties and the + // endpoints because the type can be gotten from the SSA, and + // UNDEFINED is unsupported, so it can only be a VR_RANGE. + REAL_VALUE_TYPE m_min; + REAL_VALUE_TYPE m_max; frange_props m_props; };