From patchwork Wed Oct 12 06:50:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1945 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp2466723wrs; Tue, 11 Oct 2022 23:52:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6naIAibmoJOV/9QOzIWYZbiU/E1E6FpDas1q/bWNcQT7IoOdUDJyxfzI8clofVzOqUktL4 X-Received: by 2002:a17:907:1c98:b0:78d:3b06:dc8f with SMTP id nb24-20020a1709071c9800b0078d3b06dc8fmr21372585ejc.58.1665557553660; Tue, 11 Oct 2022 23:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665557553; cv=none; d=google.com; s=arc-20160816; b=jXondPEz1Pni8QrRWGbN8vA5/L2opKjFpG8hL5NDUesr+ZpxNu+y0Szubc+aDL2Xaj gMlgEkcCTR+IbOp5WMo7/O8kj9IQdYAz3FLCjvjfFAH7Jj11CnvW30Crvz/m0lUgUH90 TVZm4z8WpqKU4kaHwHZxlnj8Ad7ICE/XurxKkKnl37uTX2A+8Hk8WiPuztLhARhGwWvr WuEkqGq1s6H/+vppXTTU+tXDHP5H55OyjHyJkLs4KmwJd+9MO2+r5kp2WFHywza2sXRE B4MLM2zExh6RUlN5jQ4mkt5DEzw4mEQHKIQF+G+hFnoQJ381Gvf14uRMDoXIaBUy4lsd bcKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=dxToyrxSuoTtqTLPflKoHJaRF4jd4jKc5GXzvgG8mis=; b=by37nyPv8JyRQ6YVcgjPZLUKg0sMidcW+TWNPXaR3y3+VdfLgxf5Dr183wo2nvGH+1 B3qOBukNt03D+quiWRR8bNSbGg8Hz1QwjEIOjCp4TVDA8TO7LY8ePLzDSG4Oo3RxvDef l28O+iHFrSoyqeBBxKe7suXaYgODxCS+wSuXL8KWkNpb55di1kBUby7V7QrYuKNK2ZoP IetJgYw4ezVjMQ4P9Q/RE6dkh0losGdB8fMphhkkcJvA9qy74JJ+mZg0OhIysbSx5cu6 GcAajHdQ48JCdl9Hge7XSh0p97LYAHpnvH4CR2QIOf8XYBHJHN8st0L0jvtlT7i9xBIn frvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=C5vFViVS; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id j6-20020a1709062a0600b0078aa0801a40si13329176eje.323.2022.10.11.23.52.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 23:52:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=C5vFViVS; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 803673851151 for ; Wed, 12 Oct 2022 06:51:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 803673851151 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665557504; bh=dxToyrxSuoTtqTLPflKoHJaRF4jd4jKc5GXzvgG8mis=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=C5vFViVS49JLjk055wdfBWFD343qFEcgFeffv3L8pv4wWD3zONbp/BODw5Vr9cGi9 DgXnk7sxZ0gMU4P5FwnLitOsB9iH+XpDGVfX0wp3nPtfpLXnnJp+3XPBi8hD1SKn8c tH+lcIIbsQag8C7v1dE2dmeW5xuqpXmvJFzWLX08= 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 4BCAD385C40E for ; Wed, 12 Oct 2022 06:50:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4BCAD385C40E 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-365-DE2shmfzNiKNn8fv1cEMPw-1; Wed, 12 Oct 2022 02:50:56 -0400 X-MC-Unique: DE2shmfzNiKNn8fv1cEMPw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A18038041DB for ; Wed, 12 Oct 2022 06:50:56 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29711414A809; Wed, 12 Oct 2022 06:50:55 +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 29C6oqWU412942 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 12 Oct 2022 08:50:53 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 29C6oqmJ412940; Wed, 12 Oct 2022 08:50:52 +0200 To: GCC patches Subject: [COMMITTED] Add default relation_kind to floating point range-op entries. Date: Wed, 12 Oct 2022 08:50:46 +0200 Message-Id: <20221012065050.412900-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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, SPF_HELO_NONE, SPF_NONE, TXREP 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746463677267009940?= X-GMAIL-MSGID: =?utf-8?q?1746463677267009940?= The methods from which these derive all have a default relation_kind. This patch just adds the default, to make it easier to write unit tests later. gcc/ChangeLog: * range-op-float.cc: Add relation_kind = VREL_VARYING to all methods. --- gcc/range-op-float.cc | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 283eb134c78..71cdd112b86 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -318,14 +318,14 @@ class foperator_identity : public range_operator_float public: bool fold_range (frange &r, tree type ATTRIBUTE_UNUSED, const frange &op1, const frange &op2 ATTRIBUTE_UNUSED, - relation_kind) const final override + relation_kind = VREL_VARYING) const final override { r = op1; return true; } bool op1_range (frange &r, tree type ATTRIBUTE_UNUSED, const frange &lhs, const frange &op2 ATTRIBUTE_UNUSED, - relation_kind) const final override + relation_kind = VREL_VARYING) const final override { r = lhs; return true; @@ -341,17 +341,17 @@ class foperator_equal : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; relation_kind op1_op2_relation (const irange &lhs) const final override { return equal_op1_op2_relation (lhs); } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { return op1_range (r, type, lhs, op1, rel); } @@ -447,14 +447,14 @@ class foperator_not_equal : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override; + relation_kind rel = VREL_VARYING) const final override; relation_kind op1_op2_relation (const irange &lhs) const final override { return not_equal_op1_op2_relation (lhs); } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; } fop_not_equal; bool @@ -548,17 +548,17 @@ class foperator_lt : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; relation_kind op1_op2_relation (const irange &lhs) const final override { return lt_op1_op2_relation (lhs); } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; } fop_lt; bool @@ -663,17 +663,17 @@ class foperator_le : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override; + relation_kind rel = VREL_VARYING) const final override; relation_kind op1_op2_relation (const irange &lhs) const final override { return le_op1_op2_relation (lhs); } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind rel = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override; + relation_kind rel = VREL_VARYING) const final override; } fop_le; bool @@ -770,17 +770,17 @@ class foperator_gt : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; relation_kind op1_op2_relation (const irange &lhs) const final override { return gt_op1_op2_relation (lhs); } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; } fop_gt; bool @@ -885,17 +885,17 @@ class foperator_ge : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; relation_kind op1_op2_relation (const irange &lhs) const final override { return ge_op1_op2_relation (lhs); } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; } fop_ge; bool @@ -996,13 +996,13 @@ class foperator_unordered : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { return op1_range (r, type, lhs, op1, rel); } @@ -1073,13 +1073,13 @@ class foperator_ordered : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { return op1_range (r, type, lhs, op1, rel); } @@ -1139,10 +1139,10 @@ class foperator_abs : public range_operator_float public: bool fold_range (frange &r, tree type, const frange &op1, const frange &, - relation_kind) const final override; + relation_kind = VREL_VARYING) const final override; bool op1_range (frange &r, tree type, const frange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind rel = VREL_VARYING) const final override; } fop_abs; bool @@ -1227,7 +1227,7 @@ class foperator_unordered_lt : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { if (op1.known_isnan () || op2.known_isnan ()) { @@ -1256,7 +1256,7 @@ class foperator_unordered_le : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { if (op1.known_isnan () || op2.known_isnan ()) { @@ -1277,10 +1277,10 @@ public: } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; } fop_unordered_le; bool @@ -1337,7 +1337,7 @@ class foperator_unordered_gt : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { if (op1.known_isnan () || op2.known_isnan ()) { @@ -1358,10 +1358,10 @@ public: } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; } fop_unordered_gt; bool @@ -1420,7 +1420,7 @@ class foperator_unordered_ge : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { if (op1.known_isnan () || op2.known_isnan ()) { @@ -1441,10 +1441,10 @@ public: } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; } fop_unordered_ge; bool @@ -1502,7 +1502,7 @@ class foperator_unordered_equal : public range_operator_float public: bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { if (op1.known_isnan () || op2.known_isnan ()) { @@ -1523,10 +1523,10 @@ public: } bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind rel) const final override; + relation_kind = VREL_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, - relation_kind rel) const final override + relation_kind rel = VREL_VARYING) const final override { return op1_range (r, type, lhs, op1, rel); }