From patchwork Mon Nov 22 08:19:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: siyu@isrc.iscas.ac.cn X-Patchwork-Id: 47988 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 AB5F53857C44 for ; Mon, 22 Nov 2021 08:19:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by sourceware.org (Postfix) with ESMTP id 7D4443858415 for ; Mon, 22 Nov 2021 08:19:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D4443858415 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=isrc.iscas.ac.cn Authentication-Results: sourceware.org; spf=none smtp.mailfrom=isrc.iscas.ac.cn Received: from localhost.localdomain (unknown [221.216.137.254]) by APP-01 (Coremail) with SMTP id qwCowACHUCN+Upthw+cjCA--.62405S4; Mon, 22 Nov 2021 16:19:11 +0800 (CST) From: siyu@isrc.iscas.ac.cn To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 2/2] RISC-V: Add implied defines of Zk, Zkn and Zks Date: Mon, 22 Nov 2021 16:19:10 +0800 Message-Id: <20211122081910.1545117-3-siyu@isrc.iscas.ac.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122081910.1545117-1-siyu@isrc.iscas.ac.cn> References: <20211122081910.1545117-1-siyu@isrc.iscas.ac.cn> MIME-Version: 1.0 X-CM-TRANSID: qwCowACHUCN+Upthw+cjCA--.62405S4 X-Coremail-Antispam: 1UD129KBjvJXoW7Ar4UXFWfZryUKryftw1kKrg_yoW8tFy3pF yjq390y34rZwn293Way34DWw4rGFn3Wry5JrnxCryUAw4kJrWj9Fn8Jw1S9w1DZF45KrnF kry0kFyrur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254] X-CM-SenderInfo: pvl13qplvuuh5lvft2wodfhubq/1tbiCwoNClz4knSJ3AAAsR X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: ben.marshall@pqshield.com, cmuellner@ventanamicro.com, andrew@sifive.com, Richard.Newell@microchip.com, jiawei@iscas.ac.cn, mjos@pqshield.com, kito.cheng@sifive.com, jimw@sifive.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: SiYu Wu gcc/ChangeLog: 2021-11-22 SiYu Wu * common/config/riscv/riscv-common.c (riscv_implied_info): Add K-ext related entry. (riscv_supported_std_ext): Add 'k'. * config/riscv/arch-canonicalize (CANONICAL_ORDER): Add 'k'. (IMPLIED_EXT): Add K-ext related entry. --- gcc/common/config/riscv/riscv-common.c | 16 +++++++++++++++- gcc/config/riscv/arch-canonicalize | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/gcc/common/config/riscv/riscv-common.c b/gcc/common/config/riscv/riscv-common.c index 14dc6057ecd..f352ff4ce7b 100644 --- a/gcc/common/config/riscv/riscv-common.c +++ b/gcc/common/config/riscv/riscv-common.c @@ -50,6 +50,20 @@ static const riscv_implied_info_t riscv_implied_info[] = {"d", "f"}, {"f", "zicsr"}, {"d", "zicsr"}, + {"zk", "zkn"}, + {"zk", "zkr"}, + {"zk", "zkt"}, + {"zkn", "zbkb"}, + {"zkn", "zbkc"}, + {"zkn", "zbkx"}, + {"zkn", "zkne"}, + {"zkn", "zknd"}, + {"zkn", "zknh"}, + {"zks", "zbkb"}, + {"zks", "zbkc"}, + {"zks", "zbkx"}, + {"zks", "zksed"}, + {"zks", "zksh"}, {NULL, NULL} }; @@ -502,7 +516,7 @@ riscv_subset_list::lookup (const char *subset, int major_version, static const char * riscv_supported_std_ext (void) { - return "mafdqlcbjtpvn"; + return "mafdqlcbjktpvn"; } /* Parsing subset version. diff --git a/gcc/config/riscv/arch-canonicalize b/gcc/config/riscv/arch-canonicalize index c7df3c8a313..90dbd194801 100755 --- a/gcc/config/riscv/arch-canonicalize +++ b/gcc/config/riscv/arch-canonicalize @@ -28,7 +28,7 @@ import itertools from functools import reduce -CANONICAL_ORDER = "imafdgqlcbjtpvn" +CANONICAL_ORDER = "imafdgqlcbjktpvn" LONG_EXT_PREFIXES = ['z', 's', 'h', 'x'] # @@ -36,6 +36,20 @@ LONG_EXT_PREFIXES = ['z', 's', 'h', 'x'] # IMPLIED_EXT = { "d" : ["f"], + "zk" : ["zkn"], + "zk" : ["zkr"], + "zk" : ["zkt"], + "zkn" : ["zbkb"], + "zkn" : ["zbkc"], + "zkn" : ["zbkx"], + "zkn" : ["zkne"], + "zkn" : ["zknd"], + "zkn" : ["zknh"], + "zks" : ["zbkb"], + "zks" : ["zbkc"], + "zks" : ["zbkx"], + "zks" : ["zksed"], + "zks" : ["zksh"], } def arch_canonicalize(arch):