From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 3B1583858D35 for ; Wed, 9 Nov 2022 09:52:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B1583858D35 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-pj1-x1033.google.com with SMTP id b1-20020a17090a7ac100b00213fde52d49so1408617pjl.3 for ; Wed, 09 Nov 2022 01:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZkcGohN+TKyry2lvZnfCs2FsqIAEorX6zIo/5vrzVrM=; b=BehIbth35jPdhCazGtzQMDbbIkZNWAHp9+gw6jrhOROt/1YC5JF0ZWrrhhmS6yHA2d DX5giXTor4Lk50IYq5EStclDfxVP0j/70fKuTIJjCIqLm01tbFWFJQCX8d8i4d0JBS5S JPBk5uxfH+IlONIhfA40TOc1U0pgsUdrWW8QFYfaTPutshESpsxiRGK22ztmx1AxOvPw cQojT/LJkr+zOs2OaKO+O4O+v+YKYmclS73YUnseQy/kSVEkCvJsKWW6WbJHL5tZL7rB iOq8guy1lC2BfeG51zVQ46i1CaUpbPZ3U7+76QXaJf4MCsAWbrE5SM/kL7Rcuz8q8W1o sxmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZkcGohN+TKyry2lvZnfCs2FsqIAEorX6zIo/5vrzVrM=; b=fUJLFax2cxTwOt9BT41I2A7Gl6YxPu3yDcwgomcy3maPHP/hFu2NT/qH74v4utBiKW N9RDVDZmhFRyXsrzBqW/nC4vGUDRfCk8qVWea9YpeXoPGIVQsAU3HU8EzsqSXSdHU4pg zMLbJDdx896GzNJXdrXrJSrpBjXoc1yO3Et8ub4bojcwnwtZjVqtlnLf6AZ++jojvrVx oHEgrlrBWpgUE4Is5nZLMhN103ZefkGILH3KDp4V00CEmx0E8HMajG0cB5oFNuyHHf3Z dBKGpKHuFAleyZcNRu6chje3BNPeluoQa8XRAkIzIpaTpY2JOMKmnX7IkVqAbsuqAQhB 3DBA== X-Gm-Message-State: ACrzQf3afrEdV8VGa4uAxH4hOH0KpT8jeW+i4stY2nUAXVzQBu3E9C5l wQerP4ZNQfydSVWtMnsgFresmHlP0LZAdLDLUtFANw== X-Google-Smtp-Source: AMsMyM5p/p5cumW4DdFvKJMqT6liA9OW4LCmHXvJoNU35/A95PI098fGWPqr9zdBqpoQZ5YuHDHYzHWEM4jxoxGVR+E= X-Received: by 2002:a17:902:d54a:b0:186:a43b:8e with SMTP id z10-20020a170902d54a00b00186a43b008emr62157250plf.36.1667987543983; Wed, 09 Nov 2022 01:52:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Wed, 9 Nov 2022 10:52:12 +0100 Message-ID: Subject: Re: [PATCH] invoke: RISC-V's -march doesn't take ISA strings To: Palmer Dabbelt Cc: gcc-patches@gcc.gnu.org, kito.cheng@sifive.com, philipp.tomsich@vrull.eu, wuwei2016@iscas.ac.cn, jiawei@iscas.ac.cn Content-Type: multipart/alternative; boundary="0000000000000c9fcc05ed069d59" X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,JMQ_SPF_NEUTRAL,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 List-Id: --0000000000000c9fcc05ed069d59 Content-Type: text/plain; charset="UTF-8" On Wed, Nov 9, 2022 at 4:00 AM Palmer Dabbelt wrote: > On Tue, 08 Nov 2022 05:40:10 PST (-0800), christoph.muellner@vrull.eu > wrote: > > On Mon, Nov 7, 2022 at 8:01 PM Palmer Dabbelt > wrote: > > > >> The docs say we take ISA strings, but that's never really been the case: > >> at a bare minimum we've required lower case strings, but there's > >> generally been some subtle differences as well in things like version > >> handling and such. We talked about removing the lower case requirement > >> in the last GNU toolchain meeting and we've always called other > >> differences just bugs. We don't have profile support yet, but based on > >> the discussions on the RISC-V lists it looks like we're going to have > >> some differences there as well. > > > > > >> So let's just stop pretending these are ISA strings. That's been a > >> headache for years now, if we're meant to just be ISA-string-like here > >> then we don't have to worry about all these long-tail ISA string parsing > >> issues. > >> > > > > You are right, we should first properly specify the -march string, > > before we talk about the implementation details of the parser. > > > > I tried to collect all the recent change requests and undocumented > > properties of the -march string and worked on a first draft > specification. > > As the -march flag should share a common behavior across different > > compilers and tools, I've made a PR to the RISC-V toolchain-conventions > > repo: > > https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/26 > > > > Do you mind if we continue the discussion there? > > IMO trying to handle this with another RISC-V spec is a waste of time: > we've spent many years trying to follow the specs here, it's pretty > clear they're just not meant to be read in that level of detail. This > sort of problem is all over the place in RISC-V land, moving to a > different spec doesn't fix the problem. > I created the documentation as a response of your comment in your patch about the flag being "woefully under-documented". You can call my attempt to address this a "waste of time", but a more constructive approach would be appreciated. The reason I created a PR over there in the riscv-toolchain-conventions repo is, that it is the agreed place to document the common behavior of RISC-V compilers/tools (e.g. command line flags). I.e. to ensure that LLVM developers can also contribute to a common solution. If I understand correctly, you want something between the documentation that you wrote as part of this patch and the PR that I created. If so, then please let me know the details you don't want to have documented in my proposal. Anyway, thanks for your feedback. I'll quote/reference it in the PR so it won't get lost. > > >> Link: https://lists.riscv.org/g/sig-toolchains/message/486 > >> > >> gcc/ChangeLog > >> > >> doc/invoke.texi (RISC-V): -march doesn't take ISA strings. > >> > >> --- > >> > >> This is now woefully under-documented, as we can't even fall back on the > >> "it's just an ISA string" excuse any more. I'm happy to go document > >> that, but figured I'd just send this along now so we can have the > >> discussion. > >> --- > >> gcc/doc/invoke.texi | 8 ++++---- > >> 1 file changed, 4 insertions(+), 4 deletions(-) > >> > >> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > >> index 94a2e20cfc1..780b0364c52 100644 > >> --- a/gcc/doc/invoke.texi > >> +++ b/gcc/doc/invoke.texi > >> @@ -28617,11 +28617,11 @@ Produce code conforming to version 20191213. > >> The default is @option{-misa-spec=20191213} unless GCC has been > configured > >> with @option{--with-isa-spec=} specifying a different default version. > >> > >> -@item -march=@var{ISA-string} > >> +@item -march=@var{target-string} > >> @opindex march > >> -Generate code for given RISC-V ISA (e.g.@: @samp{rv64im}). ISA > strings > >> must be > >> -lower-case. Examples include @samp{rv64i}, @samp{rv32g}, @samp{rv32e}, > >> and > >> -@samp{rv32imaf}. > >> +Generate code for given target (e.g.@: @samp{rv64im}). Target strings > >> are > >> +similar to ISA strings, but must be lower-case. Examples include > >> @samp{rv64i}, > >> +@samp{rv32g}, @samp{rv32e}, and @samp{rv32imaf}. > >> > >> When @option{-march=} is not specified, use the setting from > >> @option{-mcpu}. > >> > >> -- > >> 2.38.1 > >> > >> > --0000000000000c9fcc05ed069d59--