From patchwork Mon Jun 12 15:32:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1793967 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=HHpPFery; 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 4Qfwg65CG8z20QH for ; Tue, 13 Jun 2023 01:32:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 227F338560AA for ; Mon, 12 Jun 2023 15:32:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 227F338560AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686583968; bh=doOXsoIKz93AKkEz7X7uGRcTASL7dfkx6UR5SNI5iC0=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=HHpPFery3YgPA3fr29s88hnpuenW85Ev1+78aBejITKZB096e0gn2DYT8vyn9HDeQ Ra9U2ePMyZJ944mXcirA5pBWzoabwTe1vt3YtzKx3eBAd1d9KeLDPbmzsimTEE2N2D TtfrkbOlgW3r2WuucLbO/PrbecW+HtlZOi/Hr2kI= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 8128B3858D32 for ; Mon, 12 Jun 2023 15:32:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8128B3858D32 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-kShsDkwpMjmMfZuGdppZOQ-1; Mon, 12 Jun 2023 11:32:18 -0400 X-MC-Unique: kShsDkwpMjmMfZuGdppZOQ-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-75d4fb030a8so486058085a.2 for ; Mon, 12 Jun 2023 08:32:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686583934; x=1689175934; 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=IkBKFE/ixOMkby1LT6nmmo4oENywO+G+dqcrlKKsGHc=; b=hBpDB4r6rONe478pStB8Sf6XCAkdF+oQncVTpjmB6nkSxTzXe4N+5vOjL/bjm77sOB t+Jj6lspJpmfor4VhFw8vtOfFUJHTF2IFuyYWfAXhWd/G+MzEA8bA4d9V14/inJblTcO r4D3A0AOxVi4CHLAyfgnEfy9/7XCkCZwOGoi/dKHNNmdI09wZAtTvwNTWzBYyUXiIDLU S61K1/a77ERIRy+MLx4e5yH/gR8k8AqQrqQieL43paLjwFMGr5+A41BSXHkY+KsRUjzi uIpuPlIIXHCSroKRpGKRC1HdyNjogOwRCK3gMp2mxcHkaGLBRSTrc9WsRDCfVlFGQKxU YxvQ== X-Gm-Message-State: AC+VfDyGf8dyvsDhiWWeTFD+CoGARKCuKYQn15dFyRCHfCKjZ8nYwYVb BXEzmLmOEvSBYvjc+8nfO/+eRUdud9cQVjUsYpC0x1A1uqe+ghY0d03JL1/yvUmDFXg+YDHkWdh 7FTX+/w1VPs8jMCqrlQBPL4dgOKKHDUV/sanl9GHLqIz2rrAYBaLzPMCaRAqcMNAeMXYo6HHr0c tZcQ== X-Received: by 2002:a05:620a:a58:b0:760:73be:be92 with SMTP id j24-20020a05620a0a5800b0076073bebe92mr4047606qka.28.1686583934084; Mon, 12 Jun 2023 08:32:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7TCds0iFtorPyltDIIbN9Q/s9Rc3SKH2nNh3qaOP2+IJ1dGifDFMYrcHVcOvCrsE33q3J4yQ== X-Received: by 2002:a05:620a:a58:b0:760:73be:be92 with SMTP id j24-20020a05620a0a5800b0076073bebe92mr4047588qka.28.1686583933711; Mon, 12 Jun 2023 08:32:13 -0700 (PDT) Received: from ?IPV6:2607:fea8:51df:4200::ca58? ([2607:fea8:51df:4200::ca58]) by smtp.gmail.com with ESMTPSA id i2-20020a05620a074200b0075f2c1afb7fsm1575159qki.57.2023.06.12.08.32.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jun 2023 08:32:13 -0700 (PDT) Message-ID: <8e5fb19b-9df3-6acb-4f18-08514ee9ef96@redhat.com> Date: Mon, 12 Jun 2023 11:32:12 -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 2/17] - Move operator_bitwise_not 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.0 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, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, 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 5bb4c53870db1331592a89119f41beee2b17d832 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Sat, 10 Jun 2023 15:59:43 -0400 Subject: [PATCH 02/17] Move operator_bitwise_not to the unified range-op table. * range-op-mixed.h (class operator_bitwise_not): Move from... * range-op.cc (unified_table::unified_table): Add BIT_NOT_EXPR. (class operator_bitwise_not): Move from here. (integral_table::integral_table): Remove BIT_NOT_EXPR. (pointer_table::pointer_table): Remove BIT_NOT_EXPR. --- gcc/range-op-mixed.h | 13 +++++++++++++ gcc/range-op.cc | 21 +++------------------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index d31b144169d..ba04c51a2d8 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -514,4 +514,17 @@ public: relation_trio rel = TRIO_VARYING) const final override; }; +class operator_bitwise_not : public range_operator +{ +public: + using range_operator::fold_range; + using range_operator::op1_range; + bool fold_range (irange &r, tree type, + const irange &lh, const irange &rh, + relation_trio rel = TRIO_VARYING) const final override; + bool op1_range (irange &r, tree type, + const irange &lhs, const irange &op2, + relation_trio rel = TRIO_VARYING) const final override; +}; + #endif // GCC_RANGE_OP_MIXED_H diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 20cc9b0dc9c..107582a9571 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -76,6 +76,7 @@ operator_minus op_minus; operator_negate op_negate; operator_mult op_mult; operator_addr_expr op_addr; +operator_bitwise_not op_bitwise_not; // Invoke the initialization routines for each class of range. @@ -105,8 +106,9 @@ unified_table::unified_table () set (MULT_EXPR, op_mult); // Occur in both integer and pointer tables, but currently share - // integral implelmentation. + // integral implementation. set (ADDR_EXPR, op_addr); + set (BIT_NOT_EXPR, op_bitwise_not); } // The tables are hidden and accessed via a simple extern function. @@ -4080,21 +4082,6 @@ operator_logical_not::op1_range (irange &r, } -class operator_bitwise_not : public range_operator -{ - using range_operator::fold_range; - using range_operator::op1_range; -public: - virtual bool fold_range (irange &r, tree type, - const irange &lh, - const irange &rh, - relation_trio rel = TRIO_VARYING) const; - virtual bool op1_range (irange &r, tree type, - const irange &lhs, - const irange &op2, - relation_trio rel = TRIO_VARYING) const; -} op_bitwise_not; - bool operator_bitwise_not::fold_range (irange &r, tree type, const irange &lh, @@ -4602,7 +4589,6 @@ integral_table::integral_table () set (BIT_AND_EXPR, op_bitwise_and); set (BIT_IOR_EXPR, op_bitwise_or); set (BIT_XOR_EXPR, op_bitwise_xor); - set (BIT_NOT_EXPR, op_bitwise_not); } // Initialize any integral operators to the primary table @@ -4633,7 +4619,6 @@ pointer_table::pointer_table () set (MIN_EXPR, op_ptr_min_max); set (MAX_EXPR, op_ptr_min_max); - set (BIT_NOT_EXPR, op_bitwise_not); set (BIT_XOR_EXPR, op_bitwise_xor); } -- 2.40.1