Message ID | 20240108134738.998804-1-kito.cheng@sifive.com |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1027974dyq; Mon, 8 Jan 2024 05:48:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzlUYH7p9eY1dbrZgRSIUfSfJ83UnW4b9Q7likbN1Fp3MXf4+f2N56mL8jTC0/awKcfW+p X-Received: by 2002:a05:6808:13d0:b0:3bd:3873:d8a5 with SMTP id d16-20020a05680813d000b003bd3873d8a5mr114556oiw.32.1704721723147; Mon, 08 Jan 2024 05:48:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704721723; cv=pass; d=google.com; s=arc-20160816; b=BaNaxFblaKG1Kk6lHBztDGsJXfaTlXm+JdpltpFOnK9xv3faxBX2rcT/jKNzVxyQvS qx4vha2tjSOZoXTyD0UTvrwAg/DSABUHRplU5qZKoI9Owkiur3Sn2GVI0DoKmonMn/rI y0Wh9doFSCqR/RlOxtLwX3ai4G4wSPAIOT94cDFl6PXYVlxZy5i6udDPHjJzQ0pWxcKl WpDFrGS3qmph9iOuoPv9nA6efMRKL5HX0npgvDMYGBePnLJIfhvAovu/cNPSYYTosdEW k7tVl/XUD3DKE7ql0dNrqnEG51du8I+cRKeWZj9MW1AmjfsdvAswhQPwt3gvnXnx6zz7 whSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=TJGWtMsNj7erqJSGU5ZLqIKPFPVhGuGgWJqlbuYovBc=; fh=l4QX1Mt3x3WfLjBpDqJXnLxoOS47kzletE6V2Mgn7Dc=; b=LGaDgN430kIVtTtkBNHptwCBuJDOfB4aIP0dO/UR+L6Ug+zLSl5J5DTNgPa4XuDpRB oGGxhOvCyU9XfJg+mxwn5l9k091ddpYb+sHE4vouLC/1JUk/Oq3RWLYRMdGvQVmV/vxl JHttY3BsSDOA3oUY4Dr9x//0DkalzQ7dTClRZ8m18yaQFydCdA4Hh/7Q+qe+Lycy1lby hRgYFCdReWN0T+1IWAeI1AOLX3KTsbqWkaj2bxxQbPWH4nofrds8Aj+15hOgRcWxUe5M 82/rJND7qgnGmXdGl5tpHfhdA5WxCaexI7vbfruPKVKipjrjABf4lV7cKTYPGK6C93pC SovA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="CKz2LR/Y"; arc=pass (i=1); 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"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d2-20020a0cdb02000000b0067f81f84fb5si7682636qvk.410.2024.01.08.05.48.42 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 05:48:43 -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=@sifive.com header.s=google header.b="CKz2LR/Y"; arc=pass (i=1); 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"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AA8A138582BE for <ouuuleilei@gmail.com>; Mon, 8 Jan 2024 13:48:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 60EC3385DC00 for <gcc-patches@gcc.gnu.org>; Mon, 8 Jan 2024 13:47:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 60EC3385DC00 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 60EC3385DC00 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704721674; cv=none; b=lp/dRPI2qYwOpk5yTBU9FrWvVbDktK+59pfoWVKX9CkhCjg7hPYJMA/OWvnIZDdrcmsP0ddjJzaNq6z1jxhzBFzHxW1HR7Zxai+nYtPz/iIXV7c3NvnjSo/1Umso6Ga+pC2S/KvH6wM//JmY2Frka809/VD91JS1GTyjJNDzp5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704721674; c=relaxed/simple; bh=TJGWtMsNj7erqJSGU5ZLqIKPFPVhGuGgWJqlbuYovBc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=b/SwEiWRPGqRVU8Q/n3h32mqZe8OBTtNsSTR4Wpec/HoHcZz2tAZUZqlK2vi/+yEXmEelO1bQX5Qh/8xjG9+oq0rfuA6PYgwX8iTUcvRreYo5LUVD8CPQduP81NOUBy8aC55xtzwX8RrQKoFL6jFRA+9FyO5wyXYPhcCa54OZak= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1d409bcb0e7so4324135ad.1 for <gcc-patches@gcc.gnu.org>; Mon, 08 Jan 2024 05:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1704721668; x=1705326468; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=TJGWtMsNj7erqJSGU5ZLqIKPFPVhGuGgWJqlbuYovBc=; b=CKz2LR/Yk0YCKI1b7v4xFw76R+6wyKZQWZFlAe1/A+IBh3goaX1tGy+Y3CHxThL6ZW R3FeCtSMFkPf+hni+HgIXPvPli2tQ7LDCcVrPmXRMhvbe9bXRmPjnvWem6DUU3vFZY7m z2p142RfEThDvTnQl4hq8TSagd2Y2vOtOXkcRR3H7cgP8dhU2Z6Hz6lrTSVFuLhAYTZf GDW6dpkjHtlAkVmnP1VU1ZAl8j/4KkQHBWiv8AigR0HOQQ3wWj8dfWeIYYlkC0a6Sw8B jJdPLTF2KNCbYYJPQYc9+VYQz9FPXc/zTFPjMVvL+748LDwm+TylBbJMZmKdOC/nR2H9 NdUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704721668; x=1705326468; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TJGWtMsNj7erqJSGU5ZLqIKPFPVhGuGgWJqlbuYovBc=; b=ELBi/YzrhQXZsJVdG4/tInqfJQ9XHrDqxDgbIOxxgHYLjMUQ+7CP9YrolQr87J2E1K MafqgPhnnXjDqjSRoGI2NQ0YGWsba5jX8iPnvLuIM5C71vdHRLvlgit5KoshAAvCN+n8 EJ1j5lwFr5wlqY4EQ0pTH1KjadHfIAG4/afAy0wGEojmFzmuO0p142yrW4I2T04s+9P6 YfvDIMG64SrABSjVdzaEPY9z0dhJ4Nh5FNEncQjoH2yPQv9+jcY/bd2SqNT+86abgfmM 05H52Ow9B6Oz8YVbs2BVm3lPLJv/lx8xg0SA+5/cmvOyfK7eyAZygaRBVP+Z/5HXMfHq BWFw== X-Gm-Message-State: AOJu0YwjGo1hK0HJe7iHSCinnrosJpnHQXWsH4DehhpLT6F2XhvQ6sYL MJRHyLakBPO8C1ugcPW9mqOECGzEnkIFSgWjrSHL8tS0mzrkz3tYBbQEALQnVrbuZWlysZg3imI iFE5scJVM/CIpaFwY47S2TBgnubDjB3UN8vffyCravx1+0x28PklRsvadMNMYb0j2W69BesaYYt m4iBD/TzYoeS4= X-Received: by 2002:a17:902:6b42:b0:1d4:60b2:b1b1 with SMTP id g2-20020a1709026b4200b001d460b2b1b1mr1256094plt.6.1704721667517; Mon, 08 Jan 2024 05:47:47 -0800 (PST) Received: from hsinchu18.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id jc20-20020a17090325d400b001d403969b65sm4588056plb.187.2024.01.08.05.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 05:47:46 -0800 (PST) From: Kito Cheng <kito.cheng@sifive.com> To: gcc-patches@gcc.gnu.org, kito.cheng@gmail.com, jim.wilson.gcc@gmail.com, palmer@dabbelt.com, andrew@sifive.com, jeffreyalaw@gmail.com, christoph.muellner@vrull.eu Subject: [PATCH 0/5] RISC-V: Relax the -march string for accept any order Date: Mon, 8 Jan 2024 21:47:33 +0800 Message-Id: <20240108134738.998804-1-kito.cheng@sifive.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787530285356947378 X-GMAIL-MSGID: 1787530285356947378 |
Series |
RISC-V: Relax the -march string for accept any order
|
|
Message
Kito Cheng
Jan. 8, 2024, 1:47 p.m. UTC
Do you know how to build a ISA string with following extension? - g - c - zba - zbs - svnapot - zve64d - zvl128b Don't trial and error with your gcc and don't read RISC-V ISA spec! OK, I believe it's impossible for most people, even I work for RISC-V so many years, I remember most of the rule of the the canonical order, it's still hard to order that right in short time... So I think it's time to relax that for the -march string inputs, since we have so many extension today, but we still keep the canonicalization within the compiler, because we need that to handle multi-lib and also it's easier to compare different ISA string. This patch break into serveral part: 1) Small refactor patch 2) Change the way of parsing ISA string. 3) Remove unused functions 4) Update test cases 5) Update document
Comments
On 1/8/24 06:47, Kito Cheng wrote: > > Do you know how to build a ISA string with following extension? > - g > - c > - zba > - zbs > - svnapot > - zve64d > - zvl128b > > Don't trial and error with your gcc and don't read RISC-V ISA spec! OK, I believe it's impossible for most people, even I work for RISC-V so many years, I remember most of the rule of the the canonical order, it's still hard to order that right in short time... > > So I think it's time to relax that for the -march string inputs, since we have so many extension today, but we still keep the canonicalization within the compiler, because we need that to handle multi-lib and also it's easier to compare different ISA string. > > This patch break into serveral part: > 1) Small refactor patch > 2) Change the way of parsing ISA string. > 3) Remove unused functions > 4) Update test cases > 5) Update document Just because something is hard doesn't necessarily mean we should avoid it. A great example would be strict aliasing. I'd bet that 90% of C/C++ developers would get something wrong in this space. Similarly for oddities of FP arithmetic. My biggest worry is consistency across various tools. It's rather lame if GCC were on an island by itself either in being too strict or too loose. So where are the other key tools in this regard? Are we an outlier right now or will this patch make us an outlier? jeff
Oops, I should leave more context here: Actually we discussed that years ago, and most people agree with that, but I guess we are just missing that, and also the ISA string isn't so terribly long yet at that moment, however...the number of extensions are growth so fast in last year, so I think it's time to moving this forward. Also we (SiFive) will send patches for clang/LLVM to relax that as well :) https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14 On Wed, Jan 10, 2024 at 2:31 AM Jeff Law <jeffreyalaw@gmail.com> wrote: > > > On 1/8/24 06:47, Kito Cheng wrote: > > > > Do you know how to build a ISA string with following extension? > > - g > > - c > > - zba > > - zbs > > - svnapot > > - zve64d > > - zvl128b > > > > Don't trial and error with your gcc and don't read RISC-V ISA spec! OK, > I believe it's impossible for most people, even I work for RISC-V so many > years, I remember most of the rule of the the canonical order, it's still > hard to order that right in short time... > > > > So I think it's time to relax that for the -march string inputs, since > we have so many extension today, but we still keep the canonicalization > within the compiler, because we need that to handle multi-lib and also it's > easier to compare different ISA string. > > > > This patch break into serveral part: > > 1) Small refactor patch > > 2) Change the way of parsing ISA string. > > 3) Remove unused functions > > 4) Update test cases > > 5) Update document > Just because something is hard doesn't necessarily mean we should avoid it. > > A great example would be strict aliasing. I'd bet that 90% of C/C++ > developers would get something wrong in this space. Similarly for > oddities of FP arithmetic. > > My biggest worry is consistency across various tools. It's rather lame > if GCC were on an island by itself either in being too strict or too loose. > > So where are the other key tools in this regard? Are we an outlier > right now or will this patch make us an outlier? > > jeff >
On Tue, Jan 9, 2024 at 4:59 PM Kito Cheng <kito.cheng@sifive.com> wrote: > > Oops, I should leave more context here: > > Actually we discussed that years ago, and most people agree with that, but I guess we are just missing that, and also the ISA string isn't so terribly long yet at that moment, however...the number of extensions are growth so fast in last year, so I think it's time to moving this forward. > > Also we (SiFive) will send patches for clang/LLVM to relax that as well :) > > https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14 > > On Wed, Jan 10, 2024 at 2:31 AM Jeff Law <jeffreyalaw@gmail.com> wrote: >> >> >> >> On 1/8/24 06:47, Kito Cheng wrote: >> > >> > Do you know how to build a ISA string with following extension? >> > - g >> > - c >> > - zba >> > - zbs >> > - svnapot >> > - zve64d >> > - zvl128b >> > >> > Don't trial and error with your gcc and don't read RISC-V ISA spec! OK, I believe it's impossible for most people, even I work for RISC-V so many years, I remember most of the rule of the the canonical order, it's still hard to order that right in short time... >> > >> > So I think it's time to relax that for the -march string inputs, since we have so many extension today, but we still keep the canonicalization within the compiler, because we need that to handle multi-lib and also it's easier to compare different ISA string. >> > >> > This patch break into serveral part: >> > 1) Small refactor patch >> > 2) Change the way of parsing ISA string. >> > 3) Remove unused functions >> > 4) Update test cases >> > 5) Update document >> Just because something is hard doesn't necessarily mean we should avoid it. >> >> A great example would be strict aliasing. I'd bet that 90% of C/C++ >> developers would get something wrong in this space. Similarly for >> oddities of FP arithmetic. >> >> My biggest worry is consistency across various tools. It's rather lame >> if GCC were on an island by itself either in being too strict or too loose. >> >> So where are the other key tools in this regard? Are we an outlier >> right now or will this patch make us an outlier? >> >> jeff If we had fewer extensions, ensuring a canonical order is better as a code search of a fixed string will retrieve the relevant results, and I'd wish that we did not lose the strictness. Now that there are a hundred extensions, I agree that enforcing a strict order has lost its goodness...
On 1/9/24 17:58, Kito Cheng wrote: > Oops, I should leave more context here: > > Actually we discussed that years ago, and most people agree with that, > but I guess we are just missing that, and also the ISA string isn't so > terribly long yet at that moment, however...the number of extensions are > growth so fast in last year, so I think it's time to moving this forward. > > Also we (SiFive) will send patches for clang/LLVM to relax that as well :) > > https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14 > <https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14> Then let's go forward. It seems like as good a time as any with gcc-14 and llvm-18 both right around the corner. jeff
Pushed to trunk :) On Tue, Jan 16, 2024 at 10:33 PM Jeff Law <jeffreyalaw@gmail.com> wrote: > > > > On 1/9/24 17:58, Kito Cheng wrote: > > Oops, I should leave more context here: > > > > Actually we discussed that years ago, and most people agree with that, > > but I guess we are just missing that, and also the ISA string isn't so > > terribly long yet at that moment, however...the number of extensions are > > growth so fast in last year, so I think it's time to moving this forward. > > > > Also we (SiFive) will send patches for clang/LLVM to relax that as well :) > > > > https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14 > > <https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14> > Then let's go forward. It seems like as good a time as any with gcc-14 > and llvm-18 both right around the corner. > > jeff