From patchwork Fri Feb 24 05:51:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 61124 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp723725wrd; Thu, 23 Feb 2023 21:53:18 -0800 (PST) X-Google-Smtp-Source: AK7set9xl0uzaaw0VAPJbSDUxzFW8agf2l3aTNSToxYKZQ6sYZz3i4VRoR9mYnh/Iv0AXaOvzeIX X-Received: by 2002:aa7:d40c:0:b0:4af:51dc:addb with SMTP id z12-20020aa7d40c000000b004af51dcaddbmr11068304edq.19.1677217998070; Thu, 23 Feb 2023 21:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677217998; cv=none; d=google.com; s=arc-20160816; b=uHFQG98fC5XBWSAK/ed4IZ9mqvXRrZHbU3MNztQQb2Na1Sks5IF//98DnVnOuum5d2 uuRnHb2HSo8GwjlIlBqYq3PxFmVKJHWiW5rA3xK24JAlK+3NeMQBmkhk+6yLforUlpJ9 fl/kelThQUZtdt/CjU/UyB2MyazCQHkILQBwlBFs/360HRpIqAyYBYXskpQ2xeuibgrC J0X6ES7rbvtzIAeQyRmGPVISyabmrSAK7CJ7EN60zMynaUMIErsmDOfLG+N4uQ9uQHJT rVQiIi9u5vNUuNum+lRo+mTZAExHFtzssuQ0CZTaQFNn+tKGp6BtzUxxXwtlGRrU4hiE B5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=xjushq5tTS5XKtNK3xf+e9l3IJCS2bVzXnngiaSnC/M=; b=XxplR1iOzs3tK9TPLq1iHLdFvEwTVgQUmOjoA5x2ehX+p5ZNQ0puHCN6w3hBHQNqix eVO5z5tk3BNCiIcfQpYqsEFHtBtzfcfxc88/FccVeYLaWf7Gf0MetiaktdKAQkjCF006 yVkqEtjEyKRyau821S9gQXuzd9km7EnTS05sfe2znKxMMPgMq18wTSMuQhdxLBIEFsM8 SQlEcaLEg0kJ46B8HMa8CZEO08QNzLVhq4ygxOdwvn5UzeatQe0l2inrQ8CnGTd2FAcy YrnVz7Ytl9x5rJf0HqZghMQK5U4tCfLWfQMceJAaJBHiphsyxZgoCpxUhR2QAwDaNmO8 6Njw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b="XlpMgBw/"; 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" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z8-20020aa7d408000000b004aee50e538csi5870178edq.594.2023.02.23.21.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 21:53:18 -0800 (PST) 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=@vrull.eu header.s=google header.b="XlpMgBw/"; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8A512384783B for ; Fri, 24 Feb 2023 05:52:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 9E86D385843D for ; Fri, 24 Feb 2023 05:51:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E86D385843D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-wr1-x434.google.com with SMTP id l25so12374875wrb.3 for ; Thu, 23 Feb 2023 21:51:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xjushq5tTS5XKtNK3xf+e9l3IJCS2bVzXnngiaSnC/M=; b=XlpMgBw/ciFiBtZQwjGkzcuorcxCNCo6A8TdMiCt9tvHOqNsQa3LtiKnGEj1PM2vnF zTq6TpFeDnI96xIEQF9KuQILDumtohXOpUbdIPui6BZIEkp0iLXkYoiLpaDdujhp27vR cJBe1jjwFlbIHiFXc1mrLgRhO2KJbJ5jE58zvoT8FNCLpfJfj0Nr2Mgo9Pyw8oogmuqH EaOrRr4QXNh+/QYx6tiMZDsoTJHBM/I/Hq1J3xo9gWYkpS4b6J4d/qd8QJNatChH80in pG03rp+2jNDLKtPW7g9Vx1c6qtciD/uZANklk1sHcAgo2aGD1lzvNLdqo50QPRCFUu7d XqEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xjushq5tTS5XKtNK3xf+e9l3IJCS2bVzXnngiaSnC/M=; b=pnWx7vRHr5iSOv6die3JBTi2jlPTx2Q2wCx5VjL3LO6STcdZr2srn0bh4ieVEM2NSy St7HFXmdnDBnc8BGj+XiOQjLoFb5q4Xfvyn8DVO/stpew0UXYKTE5rx0c/5uF18yxSPl UDsg0CBha3Wyj29BU9O65m7JgeaOVRAb5Qlg6oOZzUxTDSK/TUyIMj6gyXeaYcLsN4Fh yqTqxdTCjGExaSBYJUKN7WLsXgDtBILueCJZUOoIQApXTXqN98lxqMJ5PK/VPjM/G34h +NgwOYjnE/QVbOPrwmEtUrhxepngkrc3J1JPLvUz1GkHdIhEWXRel58wPjECLWnocp3h 8Odg== X-Gm-Message-State: AO0yUKV+exZFOQGR5vHlerSUYFMNy3WuyxCSEP/BQjjjSM3Hpr8YkLg1 oHhx4LLvMiLvnmztOcth7TMaiVANXvUtmcRQ X-Received: by 2002:adf:fc12:0:b0:2c3:e20b:82aa with SMTP id i18-20020adffc12000000b002c3e20b82aamr13571771wrr.22.1677217894843; Thu, 23 Feb 2023 21:51:34 -0800 (PST) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id f18-20020adffcd2000000b002c59e001631sm11704055wrs.77.2023.02.23.21.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 21:51:34 -0800 (PST) From: Christoph Muellner To: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Jeff Law , Cooper Qu , Lifang Xia , Yunhai Shang , Zhiwei Liu Cc: =?utf-8?q?Christoph_M=C3=BCllner?= Subject: [PATCH v3 02/11] riscv: riscv-cores.def: Add T-Head XuanTie C906 Date: Fri, 24 Feb 2023 06:51:18 +0100 Message-Id: <20230224055127.2500953-3-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230224055127.2500953-1-christoph.muellner@vrull.eu> References: <20230224055127.2500953-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_MANYTO, KAM_NUMSUBJECT, KAM_SHORT, 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758690539448121690?= X-GMAIL-MSGID: =?utf-8?q?1758690539448121690?= From: Christoph Müllner This adds T-Head's XuanTie C906 to the list of known cores as "thead-c906". The C906 is shipped for quite some time (it is the core of the Allwinner D1). Note, that the tuning struct for the C906 is already part of GCC (it is also name "thead-c906"). gcc/ChangeLog: * config/riscv/riscv-cores.def (RISCV_CORE): Add "thead-c906". gcc/testsuite/ChangeLog: * gcc.target/riscv/mcpu-thead-c906.c: New test. Changes for v2: - Enable all supported vendor extensions Signed-off-by: Christoph Müllner --- gcc/config/riscv/riscv-cores.def | 4 +++ .../gcc.target/riscv/mcpu-thead-c906.c | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/mcpu-thead-c906.c diff --git a/gcc/config/riscv/riscv-cores.def b/gcc/config/riscv/riscv-cores.def index 2a834cae21d..7d87ab7ce28 100644 --- a/gcc/config/riscv/riscv-cores.def +++ b/gcc/config/riscv/riscv-cores.def @@ -73,4 +73,8 @@ RISCV_CORE("sifive-s76", "rv64imafdc", "sifive-7-series") RISCV_CORE("sifive-u54", "rv64imafdc", "sifive-5-series") RISCV_CORE("sifive-u74", "rv64imafdc", "sifive-7-series") +RISCV_CORE("thead-c906", "rv64imafdc_xtheadba_xtheadbb_xtheadbs_xtheadcmo_" + "xtheadcondmov_xtheadfmemidx_xtheadmac_" + "xtheadmemidx_xtheadmempair_xtheadsync", + "thead-c906") #undef RISCV_CORE diff --git a/gcc/testsuite/gcc.target/riscv/mcpu-thead-c906.c b/gcc/testsuite/gcc.target/riscv/mcpu-thead-c906.c new file mode 100644 index 00000000000..a71b43a6167 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/mcpu-thead-c906.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-skip-if "-march given" { *-*-* } { "-march=*" } } */ +/* { dg-options "-mcpu=thead-c906" { target { rv64 } } } */ +/* T-Head XuanTie C906 => rv64imafdc */ + +#if !((__riscv_xlen == 64) \ + && !defined(__riscv_32e) \ + && defined(__riscv_mul) \ + && defined(__riscv_atomic) \ + && (__riscv_flen == 64) \ + && defined(__riscv_compressed) \ + && defined(__riscv_xtheadba) \ + && defined(__riscv_xtheadbb) \ + && defined(__riscv_xtheadbs) \ + && defined(__riscv_xtheadcmo) \ + && defined(__riscv_xtheadcondmov) \ + && defined(__riscv_xtheadfmemidx) \ + && defined(__riscv_xtheadmac) \ + && defined(__riscv_xtheadmemidx) \ + && defined(__riscv_xtheadmempair) \ + && defined(__riscv_xtheadsync)) +#error "unexpected arch" +#endif + +int main() +{ + return 0; +}