From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 8C6A73858C56 for ; Tue, 8 Nov 2022 13:40:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C6A73858C56 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-pg1-x52a.google.com with SMTP id 6so5286196pgm.6 for ; Tue, 08 Nov 2022 05:40:23 -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=OPKrwddIRx1PD7JM8i5+zfVxDeryInNxR8bo1b3KQBo=; b=ep+E3Pa44uYKdHN+Vi3yHe/sPNG6ykRazBXHDKiBUZnp5J3iXp4/IOdIsTXXk233GY 63i127DVWXXa7LmgeFlYXr8FSvqW0rg1JQ4CBRW0/gADynFxg77OcpZKBKLcaZqtFFpb jv/aXSTm5l+xxqz68+WN0MJJO+93nvbxnWwKKEOdAyvQV1mbORY5KP/u5KsdGC94BynK Ezlw7F4Z+S82de14G0DWuCVz+vdJQ2sV9lEXiBNKDji14mbE4jLo68CFt9EZ8+mSt24l 2qfoWTi14pppvE/QUtAuS8OpIrBJMMQv0dwFLGGvhLp6PCvkPYGGdgDb4Y1ODfapTMM9 40pg== 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=OPKrwddIRx1PD7JM8i5+zfVxDeryInNxR8bo1b3KQBo=; b=kFfjwd7Y9YqVRLO+InDRPFYpXqQ1ZIkxTyTir2JQ9esuhkE/2y0KwpRO+7Ay+tcL0s auTmRVVEebbd5iyxqsAiCnJBlECGvDvngL5s2aL+rUo8xjRZFZQIrlCPS7ebDGEJKrDf S/MeILCa5yH9ytkfGjLMuC2ETCSqOVcw/eG41tMHaoLbVd3rb3gADoai1dM8tEkOSp5M OSyiSnrATgdDrZM+TBVF95oV2xEADaNVMttb2f2KwYOPzhPI5AQeOk6Nbu7axs0mi76i 7eVJz6Ivp/c4Zub8vHdvEUYfApltgkCawZw7hlX1pUH/B6dzrBAemgVUDynBJxDIbQJv o0UA== X-Gm-Message-State: ACrzQf12WQi8NpY0u8h3IyzNa0hSf61Qo99HV3HA5rpMZ9HUbK1zo88Y uJHvaGmE5uqjI4IMIu0vcjLbhtUy7CfE+MLHuKKp8g== X-Google-Smtp-Source: AMsMyM5MKruLF/JJ1JYL+g9bdH1xsHrOfoYhWgEOkdSovO9Zx0L/olB8RNj0V/zaCxzPHI3QnCnEko40ML3Zo8wG/rc= X-Received: by 2002:a63:194b:0:b0:457:7295:8de0 with SMTP id 11-20020a63194b000000b0045772958de0mr48934405pgz.612.1667914822535; Tue, 08 Nov 2022 05:40:22 -0800 (PST) MIME-Version: 1.0 References: <20221107185801.326-1-palmer@rivosinc.com> In-Reply-To: <20221107185801.326-1-palmer@rivosinc.com> From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Tue, 8 Nov 2022 14:40:10 +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 , =?UTF-8?Q?Christoph_M=C3=BCllner?= , Philipp Tomsich , =?UTF-8?B?V2VpIFd1ICjlkLTkvJ8p?= , jiawei Content-Type: multipart/alternative; boundary="00000000000083641c05ecf5ae0a" X-Spam-Status: No, score=-10.1 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: --00000000000083641c05ecf5ae0a Content-Type: text/plain; charset="UTF-8" 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? > > 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 > > --00000000000083641c05ecf5ae0a--