Message ID | 20230428061210.2988035-7-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:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp729026vqo; Thu, 27 Apr 2023 23:16:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ZDR/0Sb4oxqjc9nz4OJiCmzbxepX3iM3ZxJR6Jr/Tk33ndVMyy7/HUCPt3PmbwP9RO8Bg X-Received: by 2002:a17:907:1b09:b0:948:fe00:77f2 with SMTP id mp9-20020a1709071b0900b00948fe0077f2mr3987765ejc.58.1682662588099; Thu, 27 Apr 2023 23:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682662588; cv=none; d=google.com; s=arc-20160816; b=u1/yYXhNqetEOfT0Lgm37EYvay76gyKE76p24tf2NwXYhtNaijPlDe/UIE2XlV5bip QiEw3/EQEr9dTnTvbeD4Gkf5u45d8GIfhzDwpb3awYcjOPnrfm8/C613390LvIHG8NDp /FZPajFQL2SWPHTyQpj4AZeYeb+Bgs+wEsREl6BkAGn+3TcYizhxPOllUHJCfRwODHLx kxvx2dMVPtTYNb2bKzXQG+PzBNgAwnq+Ykb36sCoT/j9SepvuXq3++xnQhqIoYMcSrMn CHbsMXjqwFwbQ3a+PVDpM7Xgfm432t78pEtI3HB1QrxXPlSta+tkP87c8DWOC1u2tgZ4 vJHA== 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=vc/rsq/Wz3BvmMBob0cP9kMS0136vC3kGuubXfDPkaY=; b=K0LmnSopAla6D2nYtCEy/4aP7lB99IyHnaUzK2hVaDfDZq9Wsa478BEJ+2W+pV9GVk s9ZT9dY6KJwCIOvUU4VuI3/OvmI9PmM7DtkhXPBDblbFvpDKdQwOzhydwoFCTLHciscO yALpYgOWQLrumZVYhZtDZ0sOt+yNZTPi8z5FSAIQPRD9oHovB7dLFvdk4YoqGeMzQ+Ta INkyPEOUhrtp0mVfN9VhZcujT36dqCfSdVEFV7F6NvhbMtx+idrgPznhD8t4lzf9W8gm AITkduwJn84RSDqHkeeRvEF9gCIYDLrKGcN6V6TY7InS9bFUFbOYlDF4Dh3ohFdlh7Jg e7Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=E5hQTkKD; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hg1-20020a1709072cc100b0094efa335a49si15911460ejc.851.2023.04.27.23.16.27 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 23:16:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=E5hQTkKD; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 D47273882AD7 for <ouuuleilei@gmail.com>; Fri, 28 Apr 2023 06:13:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id 463C33857716 for <gcc-patches@gcc.gnu.org>; Fri, 28 Apr 2023 06:12:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 463C33857716 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-x535.google.com with SMTP id 4fb4d7f45d1cf-504fce3d7fbso14447625a12.2 for <gcc-patches@gcc.gnu.org>; Thu, 27 Apr 2023 23:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1682662342; x=1685254342; 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=vc/rsq/Wz3BvmMBob0cP9kMS0136vC3kGuubXfDPkaY=; b=E5hQTkKDgRpJwpoz51NcYeD+/XsGCoEe68wBLTVIm4SGtN7Q4dOYYeG/YufmecY8dn iVWrsbCAtIfYt3Ml/e9D8jt7eNsxvniWyjj/g4mL/s8/Wl7bIt5mkigh1eA7jr9C4Grz MPNG8+yZfTsHdDXLyVt1fIFLiQfqO+DK4sHIaiaI9fZo+jT7PRI+I00yhMYxkR0zB20t nkAKrZNFUSrWz7gQqbi9y8ZE1o6FSmfgLesx2DiAmxqAUsHUzfiS8WLZSVmBKZEHzdd2 b/1ENSMIdNksQVcqxZC0QWt4fseEZP+bn8kxvwiZHO8EvMgaXt9kOy36GSvptbfqeMlD rJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682662342; x=1685254342; 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=vc/rsq/Wz3BvmMBob0cP9kMS0136vC3kGuubXfDPkaY=; b=aDiTG/+utLy5pAdJ7pBKQEZjKmQj/ayCvyi758AcoEEtTpmuKuZYPnkt1EJauoElaX lQDgQUZ7FPKzZhFfxQ7HZzuHVT6OKu6djlK4o7y6EedjeNERu9UD6YE14MgP5Vxq2rXI QynhTpRsedt5qv5EHnLdCMJxq46ltTiqLEfg+2+lXlKsS93DcQ3O+8sQASDaDzjAjHB6 HAHZEP1T6lzAzAfzIenGqmQD4WfSSZ7Ii6M1UdfqnfwxApnV+CO4T90cXqJgeXfV3BEE VqY7x6/TQ2Or5armlMQqPz2il0NC9fZGYqpEddcnpIror/VrN2OV9oUat1n/9qCS/j/v bfvw== X-Gm-Message-State: AC+VfDyomJv14IUGwI8NAudTJCxOe7FowDzVl/MJSN4GBDuH/bC2V7kK Jt2AD/FABPKVkt5Irh0koKUP4a+qk6v4kIslcBc= X-Received: by 2002:a05:6402:54d:b0:506:adea:aaf2 with SMTP id i13-20020a056402054d00b00506adeaaaf2mr3420600edx.18.1682662342376; Thu, 27 Apr 2023 23:12:22 -0700 (PDT) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id x20-20020aa7d394000000b00504803f4071sm8669431edq.44.2023.04.27.23.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 23:12:21 -0700 (PDT) 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 06/11] riscv: Define Xmode macro Date: Fri, 28 Apr 2023 08:12:07 +0200 Message-Id: <20230428061210.2988035-7-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230428061210.2988035-1-christoph.muellner@vrull.eu> References: <20230428061210.2988035-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.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_MANYTO, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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?1764399605877547394?= X-GMAIL-MSGID: =?utf-8?q?1764399605877547394?= |
Series |
Improvements for XThead* support
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Christoph Müllner
April 28, 2023, 6:12 a.m. UTC
From: Christoph Müllner <christoph.muellner@vrull.eu> Define a Xmode macro that specifies the registers size (XLEN) similar to Pmode. This allows the backend code to write generic RV32/RV64 C code (under certain circumstances). gcc/ChangeLog: * config/riscv/riscv.h (Xmode): New macro. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> --- gcc/config/riscv/riscv.h | 4 ++++ 1 file changed, 4 insertions(+)
Comments
My first impression is that it should be the same as Pmode, but I admit it has more clear semantics, and would be useful when we have ilp32 on rv64. So LGTM On Fri, Apr 28, 2023 at 2:16 PM Christoph Muellner <christoph.muellner@vrull.eu> wrote: > > From: Christoph Müllner <christoph.muellner@vrull.eu> > > Define a Xmode macro that specifies the registers size (XLEN) > similar to Pmode. This allows the backend code to write generic > RV32/RV64 C code (under certain circumstances). > > gcc/ChangeLog: > > * config/riscv/riscv.h (Xmode): New macro. > > Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> > --- > gcc/config/riscv/riscv.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h > index 66fb07d6652..90746fe14e3 100644 > --- a/gcc/config/riscv/riscv.h > +++ b/gcc/config/riscv/riscv.h > @@ -791,6 +791,10 @@ typedef struct { > > #define Pmode word_mode > > +/* Specify the machine mode that registers have. */ > + > +#define Xmode (TARGET_64BIT ? DImode : SImode) > + > /* Give call MEMs SImode since it is the "most permissive" mode > for both 32-bit and 64-bit targets. */ > > -- > 2.40.1 >
diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 66fb07d6652..90746fe14e3 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -791,6 +791,10 @@ typedef struct { #define Pmode word_mode +/* Specify the machine mode that registers have. */ + +#define Xmode (TARGET_64BIT ? DImode : SImode) + /* Give call MEMs SImode since it is the "most permissive" mode for both 32-bit and 64-bit targets. */