Message ID | 20221113214636.2747737-3-christoph.muellner@vrull.eu |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1843052wru; Sun, 13 Nov 2022 13:48:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CqP/TgYQeaV2MX4K6UIYw2/mRmjMFhn0LfIraejjuauRITRxhKE54+kXSTGyePn44fz9X X-Received: by 2002:a50:fa87:0:b0:467:4a80:719b with SMTP id w7-20020a50fa87000000b004674a80719bmr9514218edr.174.1668376105211; Sun, 13 Nov 2022 13:48:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668376105; cv=none; d=google.com; s=arc-20160816; b=H/UhHyVO19tEsmVtau7yRaqFwzchbGCwj0cEokgXodrjnd8HyTBZkPG9dyURMsJXOz CR9mMzs8RZ80uMDSLcGwd2xIBrNZN/Cv1AtBbN0btlUKJvD4MFldOWd/Fjua69TlE3I8 riqwmErBJUffLbcb6J8fnJ2Mn7qy8KVS73hekEHkC6zdvOQx+KsjoWjph4ja4FdHb9W0 3PKm+bFIQWOcKGyGuPk4xcxYMaURtWP7ZLFjMjrnXyhinN2vl4HWAGuPurXvhWiwbwth af7UDp/R7PptVmBKp8TzzQtMRiwmYVcTyxEB3u/E5uB1gr3Jm1AhJClRJZrwfabFUjbg FH2w== 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=e/eWWSnHa+qcto148TgGROBQiNtNsahk7zrpPhsLJew=; b=dnM9+7/ZDc+8LWlTlKeYvN7rgm5d9wejr2A/c9qSb5BiP7rH+PLMuSZX1fS9pIQPPP ylLqAvtrn8pwUjyQ1PH7IrzY8p8WB8bmmi0GjA9xrqObiP1loIjZinXEbxCukXBBH3FM YITyqjoyphel83cWLz+toZ4hSngvFCxCEfwZfOtblCLXxwh3cRiQ1EMui0UMyXg9SXzO 4D81/M7Xt2CNMj84xw7ykaVGOWG0I5J3VUO0Fa0McUa6fPpI5RjxsdThsAh2N6PYttX4 UM7qy0Cuzi5iH50FErPJQk3Zc2iWq3AeaEC+MukNBPvwUwR4UkPwK0SUOUvMGfjpkTCQ sbIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=WRaCXidK; 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 c14-20020a05640227ce00b0045c3f5b458fsi9014078ede.397.2022.11.13.13.48.25 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 13:48:25 -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=WRaCXidK; 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 4E01D389365F for <ouuuleilei@gmail.com>; Sun, 13 Nov 2022 21:47:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id B88893857BB3 for <gcc-patches@gcc.gnu.org>; Sun, 13 Nov 2022 21:46:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B88893857BB3 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-ed1-x534.google.com with SMTP id a13so14802777edj.0 for <gcc-patches@gcc.gnu.org>; Sun, 13 Nov 2022 13:46:45 -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=e/eWWSnHa+qcto148TgGROBQiNtNsahk7zrpPhsLJew=; b=WRaCXidKxwwu0GzqBDM/QQiAg/PkUw/41pztzfJdqNcOu8vc5TSaYBEtj9gmKfn89s E21hwlq7OujU0qk8UU8mWRoNYh0Z/V92N2SQspgjCpID/8CCGaDPEZV8xGaQtimA7g3k 5ubCwRq9rOrmQFiFPPXDP7VEXB76Uj/rCb88eyaOSV1EYINchpkkND/LzuZ7hD/iI1Hu c6wwiKDxrAu1QYDwXEuNPHOFoTBqsEGZplDwj+AzFU88c2M/9gnmFa0v6CkWY1GqrXBR Rt+4jW1mnmfAu6GpWGA3Q2zR5t8w5Owsu4mogaXXWXfVcC/8DY7rfnOb7ssYM1Bhicqk 89zQ== 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=e/eWWSnHa+qcto148TgGROBQiNtNsahk7zrpPhsLJew=; b=77WUKP/uEVOLEF7q2hOfSt8zNApUh1DCyZSjeIEcaUGkBZwQm1G8VCqHQ7jTROrIaq 6xImrwEg19wVcDrL28y9vegQg+IzKSxph9kIld1/ZDIb4sDw1gHC1/RnY+4OGlHBeYGp SbMJcfeoJiFQwAxMIhzNX/6K+2ZviiYWQd9yV8VSO/W2tkjld2Ip8z6p4wVYyK4nwznd VjL/c1xwGbdPnLHbYsF408UsxI8JhEJONgKwPQ1HQy0+d2xi79qcmzVTAIi1ABcmSuGL iW+vyrXqd2TozLlqnSQLG29JHO2q42FyhggIA/8ylNMhS97yE7x+c/+YQrqsOWvOJmlH cx0g== X-Gm-Message-State: ANoB5pltNhei+EQTtnFCxd94s8QYI0gagNLiGYS8z7FzfQO4fzhMcKdm 23ZhIfEGJxocRKVHEN5EUZ8kT2BZgSa1d6L3 X-Received: by 2002:a05:6402:60a:b0:461:92bd:21cf with SMTP id n10-20020a056402060a00b0046192bd21cfmr8727282edv.405.1668376004268; Sun, 13 Nov 2022 13:46:44 -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 lb17-20020a170907785100b00734bfab4d59sm3432282ejc.170.2022.11.13.13.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 13:46:43 -0800 (PST) From: Christoph Muellner <christoph.muellner@vrull.eu> To: gcc-patches@gcc.gnu.org, Kito Cheng <kito.cheng@sifive.com>, Jim Wilson <jim.wilson.gcc@gmail.com>, Palmer Dabbelt <palmer@dabbelt.com>, Andrew Waterman <andrew@sifive.com>, Philipp Tomsich <philipp.tomsich@vrull.eu>, Cooper Qu <cooper.qu@linux.alibaba.com>, Lifang Xia <lifang_xia@linux.alibaba.com>, Yunhai Shang <yunhai@linux.alibaba.com>, Zhiwei Liu <zhiwei_liu@linux.alibaba.com> Cc: =?utf-8?q?Christoph_M=C3=BCllner?= <christoph.muellner@vrull.eu> Subject: [PATCH 2/7] riscv: riscv-cores.def: Add T-Head XuanTie C906 Date: Sun, 13 Nov 2022 22:46:31 +0100 Message-Id: <20221113214636.2747737-3-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221113214636.2747737-1-christoph.muellner@vrull.eu> References: <20221113214636.2747737-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749419142718576767?= X-GMAIL-MSGID: =?utf-8?q?1749419142718576767?= |
Series |
Add XThead* support
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Christoph Müllner
Nov. 13, 2022, 9:46 p.m. UTC
From: Christoph Müllner <christoph.muellner@vrull.eu> 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. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> --- gcc/config/riscv/riscv-cores.def | 2 ++ .../gcc.target/riscv/mcpu-thead-c906.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/mcpu-thead-c906.c
Comments
On Sun, Nov 13, 2022 at 10:46:31PM +0100, Christoph Muellner wrote: > From: Christoph Müllner <christoph.muellner@vrull.eu> > > 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. > > Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> > --- > gcc/config/riscv/riscv-cores.def | 2 ++ > .../gcc.target/riscv/mcpu-thead-c906.c | 18 ++++++++++++++++++ > 2 files changed, 20 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 31ad34682c5..648a010e09b 100644 > --- a/gcc/config/riscv/riscv-cores.def > +++ b/gcc/config/riscv/riscv-cores.def > @@ -73,4 +73,6 @@ 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", "thead-c906") > + I think it makes more sense that thead-906 includes extended instructions by default. Thanks, Cooper
On Thu, 17 Nov 2022 20:50:19 PST (-0800), gcc-patches@gcc.gnu.org wrote: > On Sun, Nov 13, 2022 at 10:46:31PM +0100, Christoph Muellner wrote: >> From: Christoph Müllner <christoph.muellner@vrull.eu> >> >> 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. >> >> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> >> --- >> gcc/config/riscv/riscv-cores.def | 2 ++ >> .../gcc.target/riscv/mcpu-thead-c906.c | 18 ++++++++++++++++++ >> 2 files changed, 20 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 31ad34682c5..648a010e09b 100644 >> --- a/gcc/config/riscv/riscv-cores.def >> +++ b/gcc/config/riscv/riscv-cores.def >> @@ -73,4 +73,6 @@ 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", "thead-c906") >> + > > I think it makes more sense that thead-906 includes extended instructions by default. Seems reasonable to me, but Kito understands this stuff better than I do. IMO `-mtune=thead-c906` should leave the ISA targets alone and just set the tune info, and `-mcpu=thead-c906` should do that and also set the ISA to whatever's implemented on that core. That said, I was playing around with some B-extension multilib stuff recently and am pretty sure this stuff is all a bit broken. Maybe we should punt on enabling all these extensions for `-mcpu` until we have that sorted out? IMO we're at the point where having ISA-dependent multilib paths on Linux makes sense, but that risks throwing another wrench into distro folks. Maybe it doesn't matter, though? IIUC distros aren't shipping multilib right now so the bugs won't manifest for users.
diff --git a/gcc/config/riscv/riscv-cores.def b/gcc/config/riscv/riscv-cores.def index 31ad34682c5..648a010e09b 100644 --- a/gcc/config/riscv/riscv-cores.def +++ b/gcc/config/riscv/riscv-cores.def @@ -73,4 +73,6 @@ 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", "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..f579e7e2215 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/mcpu-thead-c906.c @@ -0,0 +1,18 @@ +/* { 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)) +#error "unexpected arch" +#endif + +int main() +{ + return 0; +}