From patchwork Mon Jun 12 15:32:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1793975 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=op4qCsF+; 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 4Qfwjy2Ysjz20Vx for ; Tue, 13 Jun 2023 01:35:18 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4BF0C385558A for ; Mon, 12 Jun 2023 15:35:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BF0C385558A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686584116; bh=UbbGRRCaeQLL7L7unOxH5SgZujwelow7IXWw0BOyCko=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=op4qCsF+b7slfhFZOWJH4H89Zyz6sBLxop+Nc+JpR/J+N+JGnzcbiajOa0aB6OlLT jfUFajf/om6ngHCOtnItqiIXKNjKMzUAaAXCZ7BmcE8m1bYDxZBLFThakr2FdqEKgO e1yORUdNKq4FdrtRAlQUxcKdbIx4rbNjGHlv9JQI= 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 43E0B3856DDF for ; Mon, 12 Jun 2023 15:32:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43E0B3856DDF Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-Lj9qzBcxMGek4z2oclQRqg-1; Mon, 12 Jun 2023 11:32:34 -0400 X-MC-Unique: Lj9qzBcxMGek4z2oclQRqg-1 Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-461791658deso884149e0c.3 for ; Mon, 12 Jun 2023 08:32:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686583953; x=1689175953; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lNP0FMrY0CBFM3Wm3SKjkBepnwbyDyl7rvicwthNVus=; b=Wu8ONlkbmK3q2yCi0MINbUjSOhcoa0sKKmzKmQztAImfrxQhQiNXzCLeeZZWPwfQhm Y6cdQkWMsm5QNGVY/s22rGt756g12QCbYqQzOJVeA9U/cnlqre628Bnmp0L+W6vMcz5D P37OQma2PKOfW/ZLRzFsuTzLNKHL1GLC/ncePikXTeW+E41+BBVnlmt4m2Ci6dnffnEE Ylm7p5J6vAKcQuXa+ZCp1j9ykw4sJGjBd/lcf3M2r6JAUrg+RNHTmRqvgU5YFUUXvQFH 1ls2xC+luqIDIk7Tmm8HchUPkkORbk2GPMpbjZp5YXBrdAl7/OACexch7jaGzKyCShWd 6Gxg== X-Gm-Message-State: AC+VfDxpwSlgPvBmBr4i3uVruPg+hQtoiByUoUMN8V7rXVkCpiCHxCiF 2y6UuiH77UIFrZktm9ipjtFtxCME+Cbh0lUn5ncDtqb+p1peewDyC8EJ4OsWcF/LraQ4dJNHxfD 9AfrxhJemjDXVdm+xJ4/9dMM2siPJ2sUZaTkPDscCObYFpmESbnPq0OrP8jJnBiuvcKmP7YabgL ra0A== X-Received: by 2002:a1f:5fc8:0:b0:466:1a69:2928 with SMTP id t191-20020a1f5fc8000000b004661a692928mr2654177vkb.7.1686583953445; Mon, 12 Jun 2023 08:32:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7cbxFG6k6phO+nz6A+Brm5vWAJn5QCGD6uNNPA4ez9Spu4f5MenhMdHjvXF25gx/9URD702Q== X-Received: by 2002:a1f:5fc8:0:b0:466:1a69:2928 with SMTP id t191-20020a1f5fc8000000b004661a692928mr2654157vkb.7.1686583953091; Mon, 12 Jun 2023 08:32:33 -0700 (PDT) Received: from ?IPV6:2607:fea8:51df:4200::ca58? ([2607:fea8:51df:4200::ca58]) by smtp.gmail.com with ESMTPSA id i13-20020a0cf38d000000b0062df1a5e8c4sm247321qvk.27.2023.06.12.08.32.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jun 2023 08:32:32 -0700 (PDT) Message-ID: Date: Mon, 12 Jun 2023 11:32:31 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 To: gcc-patches Cc: "hernandez, aldy" Subject: [COMMITTED 6/17] - Move operator_min to the unified range-op table. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.1 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_NONE, 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: Andrew MacLeod via Gcc-patches From: Andrew MacLeod Reply-To: Andrew MacLeod Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 508645fd461ceb8b743837e24411df2e17bd3950 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 16:09:58 -0400 Subject: [PATCH 06/17] Move operator_min to the unified range-op table. * range-op-mixed.h (class operator_min): Move from... * range-op.cc (unified_table::unified_table): Add MIN_EXPR. (class operator_min): Move from here. (integral_table::integral_table): Remove MIN_EXPR. --- gcc/range-op-mixed.h | 11 +++++++++++ gcc/range-op.cc | 18 +++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index 8a11d61220c..7bd9b5e1129 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -596,4 +596,15 @@ private: const wide_int &rh_ub) const final override; }; +class operator_min : public range_operator +{ +public: + void update_bitmask (irange &r, const irange &lh, + const irange &rh) const final override; +private: + void wi_fold (irange &r, tree type, const wide_int &lh_lb, + const wide_int &lh_ub, const wide_int &rh_lb, + const wide_int &rh_ub) const final override; +}; + #endif // GCC_RANGE_OP_MIXED_H diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 07e0c88e209..a777fb0d8a3 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -80,6 +80,7 @@ operator_bitwise_not op_bitwise_not; operator_bitwise_xor op_bitwise_xor; operator_bitwise_and op_bitwise_and; operator_bitwise_or op_bitwise_or; +operator_min op_min; // Invoke the initialization routines for each class of range. @@ -119,6 +120,7 @@ unified_table::unified_table () // speifc version is provided. set (BIT_AND_EXPR, op_bitwise_and); set (BIT_IOR_EXPR, op_bitwise_or); + set (MIN_EXPR, op_min); } // The tables are hidden and accessed via a simple extern function. @@ -1980,17 +1982,12 @@ operator_pointer_diff::op1_op2_relation_effect (irange &lhs_range, tree type, } -class operator_min : public range_operator +void +operator_min::update_bitmask (irange &r, const irange &lh, + const irange &rh) const { -public: - virtual void wi_fold (irange &r, tree type, - const wide_int &lh_lb, - const wide_int &lh_ub, - const wide_int &rh_lb, - const wide_int &rh_ub) const; - void update_bitmask (irange &r, const irange &lh, const irange &rh) const - { update_known_bitmask (r, MIN_EXPR, lh, rh); } -} op_min; + update_known_bitmask (r, MIN_EXPR, lh, rh); +} void operator_min::wi_fold (irange &r, tree type, @@ -4534,7 +4531,6 @@ pointer_or_operator::wi_fold (irange &r, tree type, integral_table::integral_table () { - set (MIN_EXPR, op_min); set (MAX_EXPR, op_max); } -- 2.40.1