From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id D8D493858030 for ; Wed, 10 Jan 2024 01:39:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D8D493858030 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D8D493858030 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::534 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704850754; cv=none; b=ApKjodEHuyEY18T4OUC4vJUeRJbcT7YtuhH2VeoA4nC5Clmnh0Na9vxZhbiD+m9VKUEBpw5iZsQesxuQ7jmwEMfzM1QNDq9xMp21L0syR2K+x/r3NFeMQzi7/VUjbgZwSe1VAdGdpyi6GrkOWU/vut+K0kEBWw6t2cbZrFkiPQo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704850754; c=relaxed/simple; bh=x5RgUi6XU8HfAZHeCO5i0XKZM+EnMtGs3C/3qBC84OE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=U8e5lU5sFQfCTCJDH+AkDDhDHgzh0nxbVjhbiO1lEgyUi/IFetRLMRCFMTS9TzQB5lHMtcEku67k+iQJhmaStIKoqHDaNHK4H2vDvtzRHvl6KEUgKAVsZsfswFkOQE79XIxfAHB7TNrYQLkoLIdOgNAgkq7eTqh1hlArUFty5hY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-557bbcaa4c0so2525a12.1 for ; Tue, 09 Jan 2024 17:39:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704850750; x=1705455550; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oq/rZLTEl/7UETIH5RdyhAaFATsVuFVQuMQlhTrTItw=; b=4ebvUqrySTLCIIBBQ2Okk9PpLJb7jgyZUepTFO/tiv+FsCRqmRTwj0jNFSiP5TGNju plmXlGBrrpZGkUTum/FvW8/97f20As+FYAWp176qOYREWsnAeEXHcxeyBPhRLul2dJHr /aWMdHNTYeoVgIbvHc2GIk2gy5P99yvHLvm12l3UhNT3JFWQBbsecTi/f2zYTdi8pnFu 09cpAsyCawdu1YTcat2qFXQZu5fl3GmM82/5OO03lCZJcW893ag71GZwFpuBtQ9NkRRn 819kbvKA24lSE2052HXpbROe8TWifzKlfs4PXa/b8HLEmM5cbFWRhUHFgE8QSvq13nmB dLmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704850750; x=1705455550; h=content-transfer-encoding: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=oq/rZLTEl/7UETIH5RdyhAaFATsVuFVQuMQlhTrTItw=; b=VWpGZr1BiWav1wV9zunpHTpM2Gb44aIpeM3MLUr5BBQ4qyhhz0nzHERl2cnFS5a6I1 Er+VkbI5aFXsLG50AhDsKuaY9CCwJL6/MCVU6dCg+E7sOC4HVdQuSDxPc2ygM/0DyOZK xGXDX/iH915EaytXwjlJrGkhuteeuvFZCi/Bhs5ukhgMqRLJ/ar6rKKATWrVo4LMewGS 3K72PQMXzd0GfWlUDXhraLbkHSoht/fgcS9eD2SHkBdpMICcCN5H2oXbVAX4O7tSjC0c 7yMScQpsIlmIpxvJb1s9SqKciQH8kjuybyKq+YLckW4g4IIs6cL0vdf/D8Rc/FvFRx1t jQ/A== X-Gm-Message-State: AOJu0YynqYh8zvp2vW345LqVp/z9/e4EDJMAQoEGFYjDnGKd1xeX4K1k 4hpTeK93NbX21KA8fX0aDUD40aCcbSNN79KUOrmnJ9mPWJMZ X-Google-Smtp-Source: AGHT+IFs7py3NRmzO6F7oX6cQVg0kExEtl0L+zoyoYs5AcKIb5wSFMCfzUsM7mJ1idcx7R5rpE0zWxZA+t5wCTWldUk= X-Received: by 2002:a50:cd89:0:b0:557:24d:6135 with SMTP id p9-20020a50cd89000000b00557024d6135mr105144edi.4.1704850750458; Tue, 09 Jan 2024 17:39:10 -0800 (PST) MIME-Version: 1.0 References: <20240108134738.998804-1-kito.cheng@sifive.com> In-Reply-To: From: Fangrui Song Date: Tue, 9 Jan 2024 17:38:57 -0800 Message-ID: Subject: Re: [PATCH 0/5] RISC-V: Relax the -march string for accept any order To: Kito Cheng Cc: Jeff Law , gcc-patches@gcc.gnu.org, kito.cheng@gmail.com, jim.wilson.gcc@gmail.com, palmer@dabbelt.com, andrew@sifive.com, christoph.muellner@vrull.eu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.4 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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, Jan 9, 2024 at 4:59=E2=80=AFPM Kito Cheng w= rote: > > Oops, I should leave more context here: > > Actually we discussed that years ago, and most people agree with that, bu= t I guess we are just missing that, and also the ISA string isn't so terrib= ly long yet at that moment, however...the number of extensions are growth s= o 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=E2=80=AFAM Jeff Law = 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 wi= thin the compiler, because we need that to handle multi-lib and also it's e= asier 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 loo= se. >> >> 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... --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF