From patchwork Wed Jul 26 08:42:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1813032 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=server2.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=uKTZJlJa; dkim-atps=neutral Received: from server2.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 4R9nWN6N1Bz1yYc for ; Wed, 26 Jul 2023 18:44:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0B52385AFBD for ; Wed, 26 Jul 2023 08:44:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0B52385AFBD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690361054; bh=kusMMHuPvZF8ZHuagpbPkomrPgQybE70l6Vji5/mMYo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=uKTZJlJawLVVBnI4WnXBlTePXOoxubhJkj9IaggiqeRhJRhPBRo3h+j2wUQcl8XvV AibBKT0hYiIFaVCOqyW7pqWE2PtjhXQMtwn5DNEto1+ES3pxJHA5HK9rWnZ4Na3NI4 StPKrk6OkgcvZgblaTzd0DIr704Pyv3gFsBCduVg= 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 72F673857706 for ; Wed, 26 Jul 2023 08:42:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 72F673857706 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-694-1sGM0pf2P8e_SilPBRBnYg-1; Wed, 26 Jul 2023 04:42:39 -0400 X-MC-Unique: 1sGM0pf2P8e_SilPBRBnYg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11B34100813C for ; Wed, 26 Jul 2023 08:42:39 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9775D1401C2E; Wed, 26 Jul 2023 08:42:38 +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 36Q8gZTe043447 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 10:42:36 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 36Q8gZUM043446; Wed, 26 Jul 2023 10:42:35 +0200 To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] [range-ops] Handle bitmasks for ABS_EXPR. Date: Wed, 26 Jul 2023 10:42:17 +0200 Message-ID: <20230726084224.43416-3-aldyh@redhat.com> In-Reply-To: <20230726084224.43416-1-aldyh@redhat.com> References: <20230726084224.43416-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.4 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_H4, 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: 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" gcc/ChangeLog: * range-op-mixed.h (class operator_abs): Add update_bitmask. * range-op.cc (operator_abs::update_bitmask): New. --- gcc/range-op-mixed.h | 2 ++ gcc/range-op.cc | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index ead41ed0515..70550c52232 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -408,6 +408,8 @@ class operator_abs : public range_operator bool op1_range (frange &r, tree type, const frange &lhs, const frange &op2, relation_trio rel = TRIO_VARYING) const final override; + 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, diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 13ba973a08d..bfab53caea0 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -4208,6 +4208,12 @@ operator_abs::op1_range (irange &r, tree type, return true; } +void +operator_abs::update_bitmask (irange &r, const irange &lh, + const irange &rh) const +{ + update_known_bitmask (r, ABS_EXPR, lh, rh); +} class operator_absu : public range_operator {