From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 709CA385800F for ; Wed, 9 Nov 2022 03:00:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 709CA385800F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-x42a.google.com with SMTP id v28so15473282pfi.12 for ; Tue, 08 Nov 2022 19:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=uWNH+Ofir3FA6L64tVrYc68VipyZrIE5c3xtyLfhUNI=; b=QK/lFHfDggXhf6T6JcflLMA9Oo3OcU053y8yq34JaIAm0Suf9aGPkATVv6COlXqN7l tEnGorImRmalnCpqfu29HVrGZZILIfj/Q/pyXgEbdh+FKJveTmkRGLFJ34f4xwuzdoz3 chZHbDaBR/PwnpIKPwWHcOvm19jWM6x8K/7T4yeEd6MViKQC0XLkH9392HuKEPFN/gli zW2HnmWfmiHTUqCF5QrGY5oig+kJvB9AMr3Ja+pZg3j1AwAWivRZC64t+BadIXO2ga93 bGo0K4qGO3b7md6zGyRbD7Bs8CPmr19X/qz2AuHknRrXep4bTeLWbBOYQZ7VKDkAKRlb nB7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uWNH+Ofir3FA6L64tVrYc68VipyZrIE5c3xtyLfhUNI=; b=L+RmGGRjgQcqIMqPK5qc4z8dofgSwaEh5vMA0V4QSqPKuXDD6IZYMyyzluPt6dogsu 9vQXJHRpEBU7ZNAF2DTnQLehKYjreW7+vtPmdApQoc2Gg6xf4C2eJa9pu8ixPUdixpZK 8WSNdoivqR0rtvAR2Jm0R9qkey4M8o7glHP7rOxuL/coPKkotos5YHWpgaELMWNJUJ4q S5KAkZK6wy8LgRvTzm/xMjDS3b5JfeG8yzNKtbHIp02dmlia6dmcgBaV66I4Mqu66fz/ XGg2S9ZpXVtQH5WwSqcSm6sgKgUApZ5wirgYIfNpdapz/IWk8kNCsrrRHU8el2xlzdd3 IrPw== X-Gm-Message-State: ACrzQf1LAjf/gafwawvw5oV7imv/n07RjEIE05rSHXy8un1PQkiclDiV AFgiw26bcLwhQgh33zqa8GKZyr/LcyKf0w== X-Google-Smtp-Source: AMsMyM5hGNTMvKDP1vObErARQ0IFi6laUdvnlDPdir9Gds9wVRr8hxFiycR8ErPsG30LIf8nQPApFw== X-Received: by 2002:a63:82c3:0:b0:470:9d9:c2a9 with SMTP id w186-20020a6382c3000000b0047009d9c2a9mr31768968pgd.255.1667962851122; Tue, 08 Nov 2022 19:00:51 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id a13-20020a63e84d000000b0046ae5cfc3d5sm6392018pgk.61.2022.11.08.19.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 19:00:50 -0800 (PST) Date: Tue, 08 Nov 2022 19:00:50 -0800 (PST) X-Google-Original-Date: Tue, 08 Nov 2022 19:00:44 PST (-0800) Subject: Re: [PATCH] invoke: RISC-V's -march doesn't take ISA strings In-Reply-To: CC: gcc-patches@gcc.gnu.org, kito.cheng@sifive.com, christoph.muellner@vrull.eu, philipp.tomsich@vrull.eu, wuwei2016@iscas.ac.cn, jiawei@iscas.ac.cn From: Palmer Dabbelt To: christoph.muellner@vrull.eu Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,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: 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. >> 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 >> >>