From patchwork Mon Mar 6 03:14:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Collison X-Patchwork-Id: 66017 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F2586385B532 for ; Mon, 6 Mar 2023 03:14:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by sourceware.org (Postfix) with ESMTPS id 32DE03858D35 for ; Mon, 6 Mar 2023 03:14:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32DE03858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-qv1-xf2b.google.com with SMTP id ev13so5748040qvb.10 for ; Sun, 05 Mar 2023 19:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:content-language:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=iX0wiK4pJT4otjVcSI9iwKGpAO9EORoRnJSqEsuVmZA=; b=TkhwTraCpmJaQflx2rSBIb1tlvG7vE8+zrLWvst5jfPQNfuah3DiLlpIopRoj0pNyi zC/ynK1bJtWUzNXaPlNB/85/Xs9RERQ2LnsfKAi94b9TH0rctGRTi7bXDMCzAxFHb1RD cEhhCvEJOlDoh7jznCjtebJmMQFlYTmHxCYX8j02ivwJWLFMdH179IJFIRd1aIxmM6Be nyY9e4LqLZrqrFOV69xL/IrRvFsH6O8N8ZQwNlMwvgyy9HsSQsDbXFyePvufW2hVkjtU I6rOdNl6+jfiavzpzwpkmEPNIkEF1DOuXfnT1wnhyWhTaO+PrTlBcnKSudNosGg1KBXd etcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iX0wiK4pJT4otjVcSI9iwKGpAO9EORoRnJSqEsuVmZA=; b=CR+aI/wM5X1MLg5WWKF5q9Vpmyq59c20RQWl+tw04pp1ZL4z9TghVUwisYVcztnJM1 v21uOLyZVEmx/UrSzsQv1czhe2TAbdMT11l93mzF83R7ZnAoJ8VBkjJgj6jq4U6snfhD kOtc8g4rUKWsQnM7zGI4lnn5Pks/+gbij+kAqcdH6Ev92lJDm3Ag6JJtcb47jnLQh4s5 HoZ+20SIl45RvlFHwsqxHV8KkgLMmJdkfq9tYYQk5fkwSaC4ijd4P7ClGRRFtTjIHZNT GASotHO2Z9KRyKUrCBTkWRFaU5xdFCWdCyODEPtxunFi/vjPQ2HsrCYYgrgHId5VU+nQ IAGQ== X-Gm-Message-State: AO0yUKVMEach1sL4n6ZTszsWuo6RXbP+W3PdCkZoJUrdYCu7uxVwGqc2 A8yxPvoDrXK+YLNa+apXKkDcJ4tD7UfIpnKvFsM= X-Google-Smtp-Source: AK7set91j5adqOeGdsNytBEF1DdAgbqwHDxhIXhFuboWwlWKyT9kUFs/2FWaKGMMWBJd02PGmJbD3Q== X-Received: by 2002:a05:6214:62e:b0:56e:a791:37c6 with SMTP id a14-20020a056214062e00b0056ea79137c6mr15915630qvx.16.1678072464226; Sun, 05 Mar 2023 19:14:24 -0800 (PST) Received: from [192.168.86.117] ([136.57.172.92]) by smtp.gmail.com with ESMTPSA id 4-20020a370304000000b0073bb00eb0besm6723122qkd.22.2023.03.05.19.14.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Mar 2023 19:14:23 -0800 (PST) Message-ID: Date: Sun, 5 Mar 2023 22:14:23 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 From: Michael Collison Subject: [PATCH v2 02/07] RISC-V: autovec: Export policy functions to global scope To: gcc-patches Content-Language: en-US X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This patch adds foundational support by making two functions that handle predication policies visibly globally. gcc/ChangeLog: 2023-03-02  Michael Collison                     Juzhe Zhong                 * config/riscv/riscv-vector-builtins.cc (get_tail_policy_for_pred):                 Remove static declaration to to make externally visible.                 (get_mask_policy_for_pred): Ditto.                 * config/riscv/riscv-vector-builtins.h (get_tail_policy_for_pred):                 New external declaration.                 (get_mask_policy_for_pred): Ditto. ---  gcc/config/riscv/riscv-vector-builtins.cc | 4 ++--  gcc/config/riscv/riscv-vector-builtins.h  | 2 ++  2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/riscv/riscv-vector-builtins.cc b/gcc/config/riscv/riscv-vector-builtins.cc index 2d57086262b..352ffd8867d 100644 --- a/gcc/config/riscv/riscv-vector-builtins.cc +++ b/gcc/config/riscv/riscv-vector-builtins.cc @@ -2448,7 +2448,7 @@ use_real_merge_p (enum predication_type_index pred)  /* Get TAIL policy for predication. If predication indicates TU, return the TU.     Otherwise, return the prefer default configuration.  */ -static rtx +rtx  get_tail_policy_for_pred (enum predication_type_index pred)  {    if (pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu) @@ -2458,7 +2458,7 @@ get_tail_policy_for_pred (enum predication_type_index pred)  /* Get MASK policy for predication. If predication indicates MU, return the MU.     Otherwise, return the prefer default configuration.  */ -static rtx +rtx  get_mask_policy_for_pred (enum predication_type_index pred)  {    if (pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu) diff --git a/gcc/config/riscv/riscv-vector-builtins.h b/gcc/config/riscv/riscv-vector-builtins.h index 8464aa9b7e9..d62d2bdab54 100644 --- a/gcc/config/riscv/riscv-vector-builtins.h +++ b/gcc/config/riscv/riscv-vector-builtins.h @@ -456,6 +456,8 @@ extern const char *const operand_suffixes[NUM_OP_TYPES];  extern const rvv_builtin_suffixes type_suffixes[NUM_VECTOR_TYPES + 1];  extern const char *const predication_suffixes[NUM_PRED_TYPES];  extern rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1]; +extern rtx get_tail_policy_for_pred (enum predication_type_index pred); +extern rtx get_mask_policy_for_pred (enum predication_type_index pred);  inline tree  rvv_arg_type_info::get_scalar_type (vector_type_index type_idx) const