From patchwork Fri Mar 3 04:52:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Collison X-Patchwork-Id: 65950 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 90A20384FB7A for ; Fri, 3 Mar 2023 04:53:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by sourceware.org (Postfix) with ESMTPS id C58B7385B50C for ; Fri, 3 Mar 2023 04:52:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C58B7385B50C 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-qt1-x829.google.com with SMTP id s12so1695972qtq.11 for ; Thu, 02 Mar 2023 20:52:56 -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=6QKW991zfW0dw9V1XZxaOyiNvFtp5nbAd0gKdfGUnE4=; b=KQ5vlxVmG5xRT/E6OtMURJBlWhlETGAadF+HSYBAMAyUt2wiP6pQobOOVCt1l8MgV0 pvlCJ32/kw+TaY1XVVAnf+pWRE3mZ52wVfbHwVpcTj+LaaCOt7PU5CWOsc2teUShagXy IXuTVYEeS6boyV2FGAr/FcGK/Qai95+cGwfFE2knCQA40JNTi9XrIudz1aq3UsEnVdTj IlUYzVWlxYT2KF8GsSrjKk5pxgt2cby+bqd/R1vQAeovBAni10RqXrnoy44cJYbscHw4 jSAqaXCnu9jkjqx5PWfm2CjsiNVb8h/MpIYQTpWdUKDEfAtKazTvCuSl/eAOXHzjXPtC T72Q== 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=6QKW991zfW0dw9V1XZxaOyiNvFtp5nbAd0gKdfGUnE4=; b=4oBrgdsz1nfD/ExktwekIDs/wi7o/YEKJfWHChg8b8v0tX+KMOPGpibv6ezO1pcCfR qWxyCTc0Ki9YmzRUdgejEdvKnJvdfVkI/5urEFOIFFUMzD0sm+9Tv2uEmGfWT0jgL7Xs bUXzVMzfj4xD99A7Ao1ZNB5sapOMsmEI0wP4EDR+rtYH2vhV3/3GHgpBsX4mW46cOkIK tkpSHBy3zFQkzxLEqXyOUHX6vAh9NB+eqaY6HsK8nOjrBled/eG8W2CVaHJxnvkZaI6Y qwPInhLppe3kV3wjYKscOC7mqNrwhCoE4j381Hl3K0WqNXkgkD3htWBokNyZ/KJSC+cQ ejDg== X-Gm-Message-State: AO0yUKVyIwwnDzelGN2W8yCYMG723lEhExY3j5X0bvXiuREy1DNAQYQc GYYG/HX8BqYUDg7WFrsR0F+ZV+DgcCoF6xQL X-Google-Smtp-Source: AK7set+8Mr4Q5+WAhCGk/5fGtg4RdxVL5lUktmnRzKWrsyfINunQk9A5N3SdiWaWlFxKAfxIPFyZ5g== X-Received: by 2002:ac8:5c90:0:b0:3b6:9c63:5ca1 with SMTP id r16-20020ac85c90000000b003b69c635ca1mr1101804qta.43.1677819175874; Thu, 02 Mar 2023 20:52:55 -0800 (PST) Received: from [192.168.86.117] ([136.57.172.92]) by smtp.gmail.com with ESMTPSA id q25-20020a37f719000000b007343fceee5fsm1044998qkj.8.2023.03.02.20.52.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Mar 2023 20:52:55 -0800 (PST) Message-ID: Date: Thu, 2 Mar 2023 23:52:55 -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 02/07] RISC-V: Add auto-vectorization support To: gcc-patches Content-Language: en-US X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, 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:     * 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 2e92ece3b64..90fc73a5bcf 100644 --- a/gcc/config/riscv/riscv-vector-builtins.cc +++ b/gcc/config/riscv/riscv-vector-builtins.cc @@ -1850,7 +1850,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) @@ -1860,7 +1860,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 ede08c6a480..135e2463b1e 100644 --- a/gcc/config/riscv/riscv-vector-builtins.h +++ b/gcc/config/riscv/riscv-vector-builtins.h @@ -433,6 +433,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 bool  function_instance::operator!= (const function_instance &other) const