| Message ID | 0450f2b8-fa5b-4921-b330-d9fe2e2c54b2@suse.com |
|---|---|
| State | New |
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org>
X-Original-To: patchwork@sourceware.org
Delivered-To: patchwork@sourceware.org
Received: from vm01.sourceware.org (localhost [IPv6:::1])
by sourceware.org (Postfix) with ESMTP id BC1994BAE7CD
for <patchwork@sourceware.org>; Fri, 19 Jun 2026 11:49:48 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC1994BAE7CD
Authentication-Results: sourceware.org;
dkim=pass (2048-bit key,
unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256
header.s=google header.b=gbTITOJn
X-Original-To: binutils@sourceware.org
Delivered-To: binutils@sourceware.org
Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com
[IPv6:2a00:1450:4864:20::335])
by sourceware.org (Postfix) with ESMTPS id 4F5374BAD158
for <binutils@sourceware.org>; Fri, 19 Jun 2026 11:48:58 +0000 (GMT)
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F5374BAD158
Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none)
header.from=suse.com
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4F5374BAD158
Authentication-Results: sourceware.org;
arc=none smtp.remote-ip=2a00:1450:4864:20::335
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781869738; cv=none;
b=cNvamdKzBtCFSvqUjb0NRB6Gwp+fnWCDL6xwq5jdsuwHTAbkO6spZjkiu58GlE++tneYB9P2cVlorg+6ZZi72aEeHIDildf0C5c/2cjam39EXVV4dl0V+oMH4vXJoibiq+Ly3hOS2bTs+Ofzk7f0u/4l9dmDovE0TxqUG2QagFU=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1781869738; c=relaxed/simple;
bh=Y4PRBeH4sv8fpNWgfS3vXNbe+qb01JySOGfzSnV4KQA=;
h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To;
b=I+cV1aJSzpzt47AeNcqKWltzpGWnWIxyxzc/9oGUWs+hzOwj5euPe0hux/AIoZj6WMeXk7+WdevaQkeJUhCB7NFnEu3cpJ5wbHsPjkUHlo/eHpd7ZHFw+ZPfVnyMAEQ3LqI2Y0ForiAUm89bW9zLD8MDV5SkGb5MHmqkf4Azi80=
ARC-Authentication-Results: i=1; sourceware.org;
dkim=pass (2048-bit key, unprotected)
header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google
header.b=gbTITOJn
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F5374BAD158
Received: by mail-wm1-x335.google.com with SMTP id
5b1f17b1804b1-4903d730b1fso26325815e9.2
for <binutils@sourceware.org>; Fri, 19 Jun 2026 04:48:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=suse.com; s=google; t=1781869737; x=1782474537; darn=sourceware.org;
h=content-transfer-encoding:in-reply-to:autocrypt:content-language
:references:cc:to:from:subject:user-agent:mime-version:date
:message-id:from:to:cc:subject:date:message-id:reply-to;
bh=mWdUuuk4XOw0liGe/R9v0jSQOyCxEu5nVeDGfZns2hs=;
b=gbTITOJnbuy4oCucLeUac1RCcN7z91hniQnd0v3oBVhoTBYKYfVzISHdeQmzSjfQNa
JFgvsSZ3wjB5QHt0lSBkftwTecwKZVoh3AYJtpWrRHahdNIlG8pivvwQ0bFZFQuY5MPb
2I7Lxl4kPLI6AarhR1ybK4VBAJGHuDbqPyL95e/Xgp9HBw3ZuoTW3UjuaVfCfGcwH8o1
WEWHGy/JppbA4o10mx8Gc3aPTNrwRYgTpXGUeuORgwDQ9PVvNW2v2GPYl5XLKhGJjLAN
Q3p9LVett8Jmo8fKfIyhg4duH5kAcmjTPsZhgtdfkvI1FXApUaW4xNon9LmfWHv6DoY2
btaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20251104; t=1781869737; x=1782474537;
h=content-transfer-encoding:in-reply-to:autocrypt:content-language
:references:cc:to:from:subject:user-agent:mime-version:date
:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to;
bh=mWdUuuk4XOw0liGe/R9v0jSQOyCxEu5nVeDGfZns2hs=;
b=HKAUizOLNL5UPB6pqRYjepHP5HkD8qTiR1pLiIeo0VRXngpYEdsAJGu4hwR5bFrVkE
/obGkZ5Ju7bGdB308JveKRyv+nlzNL0wZ61Ciq8QTwreKHge/NdOMzlTe5CvQLrvXwcZ
bXy8LDSOB/XYXLOuip9hA6lxFwtD/ibo/xcoWO6Xs7p3vl7MFa5XGmqJAygAdcv3UXfL
a5ORzoR9zaT6p8BvSLNNDuuBcFDC0tHRN2QWZ7Fg4XSRAkVLMkNRszwrzRGFAGdxZRce
6tlX8bzvtsbzBbMxKjSXJRJRLirK5mgL3Xid1MtFKc2E/ETIkTECze9BHodkgDijirdk
WMCw==
X-Gm-Message-State: AOJu0YzuUj7cybMLa3VjrBkpLiyOUeeZl9TLhE4d6tJyek1N4utvkICB
giQbxdJuRAbjz/3OabGwCorEW6/2tUKlKqNDBlEAUw3qfefnxSquTnHot+CSxJzpCwgYDSNcTnh
79FqFfA==
X-Gm-Gg: AfdE7cm533szJQB0t7SzADZOsaW1w6JPPCvh0oAxlc4YQLySz4MERoI45vtFq10/uC8
oy6Tbyk1VW7NCGAySp4ptIAhcONzEm3CGWMfurEXmPElhaaPrysVfONCh6FvzliCfBezwqwJoDc
uOLfRlvBlhqiRaMSUo3Cz09T0w8SVecRr6ejKRrCGQUXcESG1frbxutnS96J7O3eM7GLxRvTzJQ
OLFfIaWdaOgxcWQ4FnbYSZtpLm9KOHReegDF2sZ37w+oxaQhoB5tunMp6IRLkcY1GZIUgsHIHBY
uPyWT2HgaXmViklqpmHk6dFHf41HAiZqcpXcebQSOQtsy8LccKd/0Go8GXvmC6r6cEpy6cjuW9E
HlR9HdxYq5lQ5H4mVmFVIELOCKynxAa8ihqBOC0KPA34a45qD/L9T/Av1maPjgjbVFAumsYVBeg
sRuGUh35Fskoe8++Vh/Ov9okQq6bE2r1QvD/AIDR8HjOKMvD/Hvy/uDwGudI7i59alxQ/JZB6nR
qI9
X-Received: by 2002:a05:600c:45d4:b0:490:e5c1:b8c0 with SMTP id
5b1f17b1804b1-4923ef47d62mr64484285e9.5.1781869737175;
Fri, 19 Jun 2026 04:48:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
[37.24.206.209]) by smtp.gmail.com with ESMTPSA id
ffacd0b85a97d-4650bc428d9sm7429738f8f.27.2026.06.19.04.48.56
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Fri, 19 Jun 2026 04:48:56 -0700 (PDT)
Message-ID: <0450f2b8-fa5b-4921-b330-d9fe2e2c54b2@suse.com>
Date: Fri, 19 Jun 2026 13:48:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v3 04/13] bfd/RISC-V: Zv{b,k}* imply Zve32x
From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>, Andrew Waterman <andrew@sifive.com>,
Jim Wilson <jim.wilson.gcc@gmail.com>, Nelson Chu
<nelson.chu1990@gmail.com>, jiawei <jiawei@iscas.ac.cn>
References: <8243b692-4895-420c-b2d0-27ee3b714732@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
/0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <8243b692-4895-420c-b2d0-27ee3b714732@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-3016.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,
SPF_NONE,
TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org
X-BeenThere: binutils@sourceware.org
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: Binutils mailing list <binutils.sourceware.org>
List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>,
<mailto:binutils-request@sourceware.org?subject=unsubscribe>
List-Archive: <https://sourceware.org/pipermail/binutils/>
List-Post: <mailto:binutils@sourceware.org>
List-Help: <mailto:binutils-request@sourceware.org?subject=help>
List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>,
<mailto:binutils-request@sourceware.org?subject=subscribe>
Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org
|
| Series |
RISC-V: assorted fixes and (hopefully) improvements
|
|
Commit Message
Jan Beulich
June 19, 2026, 11:48 a.m. UTC
The specification is quite explicit about this. --- Is the placement of "zve32x" after "zvbb" / "zvbc" actually correct? While riscv_compare_subsets() indeed does a mere strcasecmp() past "zv", it seems unlikely to be mere chance that Zve* come ahead of all other Zv* in riscv_supported_std_z_ext[]. --- v3: New.
Comments
Hi Jan,
I checked this locally with current binutils using as-new/readelf.
For the ordering question, the canonical order does not seem to come
from the
order in riscv_supported_std_z_ext[]. riscv_compare_subsets() compares Z
extensions by the character after 'z' and then by a case-insensitive suffix
comparison. For Zv* extensions, this means the current canonical order is
roughly:
zvbb, zvbc, zve32x, zvkb, zvkg, zvkn*, zvks*
The assembler/readelf tests confirm this. For example, both
-march=rv32i_zvbc_zve32x
-march=rv32i_zve32x_zvbc
are canonicalized with zvbc before zve32x, while zvkb/zvkg/zvkn*/zvks* are
placed after zve32x. So the ordering in the updated imply.d output looks
consistent with the current canonicalization rule.
However, while testing the implied-dependency change, I noticed another
possible issue. With the new implicit rows, an input such as
-march=rv32i_zvbc
is canonicalized as:
rv32i2p1_zvbc1p0_zve32x1p0
whereas explicitly specifying zve32x, for example
-march=rv32i_zvbc_zve32x
produces:
rv32i2p1_zicsr2p0_zvbc1p0_zve32x1p0_zvl32b1p0
So adding zve32x through the new Zv{b,k}* implication does not seem to
trigger
the further dependencies normally implied by zve32x. This looks like it may
come from the implicit-subset processing order / single forward scan.
Therefore, I think the canonical placement of zve32x in the test is correct
for the current ordering rule, but we may need to clarify whether the
implied
dependency should also pull in the full zve32x dependency closure.
BR,
Jiawei
On 2026/6/19 19:48, Jan Beulich wrote:
> The specification is quite explicit about this.
> ---
> Is the placement of "zve32x" after "zvbb" / "zvbc" actually correct? While
> riscv_compare_subsets() indeed does a mere strcasecmp() past "zv", it
> seems unlikely to be mere chance that Zve* come ahead of all other Zv* in
> riscv_supported_std_z_ext[].
> ---
> v3: New.
>
> --- a/bfd/elfxx-riscv.c
> +++ b/bfd/elfxx-riscv.c
> @@ -1306,6 +1306,15 @@ static const struct riscv_implicit_subse
> {"zvksc", "+zvks,+zvbc", check_implicit_always},
> {"zvks", "+zvksed,+zvksh,+zvkb,+zvkt", check_implicit_always},
>
> + {"zvbc", "+zve32x", check_implicit_always},
> + {"zvkb", "+zve32x", check_implicit_always},
> + {"zvkg", "+zve32x", check_implicit_always},
> + {"zvkned", "+zve32x", check_implicit_always},
> + {"zvknha", "+zve32x", check_implicit_always},
> + {"zvknhb", "+zve32x", check_implicit_always},
> + {"zvksed", "+zve32x", check_implicit_always},
> + {"zvksh", "+zve32x", check_implicit_always},
> +
> {"sdtrig", "+zicsr", check_implicit_always},
>
> {"smaia", "+ssaia", check_implicit_always},
> --- a/gas/testsuite/gas/riscv/imply.d
> +++ b/gas/testsuite/gas/riscv/imply.d
> @@ -87,13 +87,13 @@ SYMBOL TABLE:
> [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zk1p0_zkn1p0_zknd1p0_zkne1p0_zknh1p0_zkr1p0_zkt1p0
> [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zkn1p0_zknd1p0_zkne1p0_zknh1p0
> [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zks1p0_zksed1p0_zksh1p0
> -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbb1p0_zvkb1p0
> -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkg1p0_zvkn1p0_zvkned1p0_zvkng1p0_zvknhb1p0_zvkt1p0
> -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zvkb1p0_zvkn1p0_zvknc1p0_zvkned1p0_zvknhb1p0_zvkt1p0
> -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkn1p0_zvkned1p0_zvknhb1p0_zvkt1p0
> -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkg1p0_zvks1p0_zvksed1p0_zvksg1p0_zvksh1p0_zvkt1p0
> -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zvkb1p0_zvks1p0_zvksc1p0_zvksed1p0_zvksh1p0_zvkt1p0
> -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvks1p0_zvksed1p0_zvksh1p0_zvkt1p0
> +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbb1p0_zve32x1p0_zvkb1p0
> +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkg1p0_zvkn1p0_zvkned1p0_zvkng1p0_zvknhb1p0_zvkt1p0
> +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zve32x1p0_zvkb1p0_zvkn1p0_zvknc1p0_zvkned1p0_zvknhb1p0_zvkt1p0
> +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkn1p0_zvkned1p0_zvknhb1p0_zvkt1p0
> +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkg1p0_zvks1p0_zvksed1p0_zvksg1p0_zvksh1p0_zvkt1p0
> +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zve32x1p0_zvkb1p0_zvks1p0_zvksc1p0_zvksed1p0_zvksh1p0_zvkt1p0
> +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvks1p0_zvksed1p0_zvksh1p0_zvkt1p0
> [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_sdtrig1p0
> [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_smaia1p0_ssaia1p0
> [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_smcdeleg1p0_ssccfg1p0_sscsrind1p0
On 22.06.2026 10:47, Jiawei wrote: > I checked this locally with current binutils using as-new/readelf. > > For the ordering question, the canonical order does not seem to come > from the > order in riscv_supported_std_z_ext[]. riscv_compare_subsets() compares Z > extensions by the character after 'z' and then by a case-insensitive suffix > comparison. For Zv* extensions, this means the current canonical order is > roughly: > > zvbb, zvbc, zve32x, zvkb, zvkg, zvkn*, zvks* > > The assembler/readelf tests confirm this. For example, both > > -march=rv32i_zvbc_zve32x > -march=rv32i_zve32x_zvbc > > are canonicalized with zvbc before zve32x, while zvkb/zvkg/zvkn*/zvks* are > placed after zve32x. So the ordering in the updated imply.d output looks > consistent with the current canonicalization rule. > > However, while testing the implied-dependency change, I noticed another > possible issue. With the new implicit rows, an input such as > > -march=rv32i_zvbc > > is canonicalized as: > > rv32i2p1_zvbc1p0_zve32x1p0 > > whereas explicitly specifying zve32x, for example > > -march=rv32i_zvbc_zve32x > > produces: > > rv32i2p1_zicsr2p0_zvbc1p0_zve32x1p0_zvl32b1p0 > > So adding zve32x through the new Zv{b,k}* implication does not seem to > trigger > the further dependencies normally implied by zve32x. This looks like it may > come from the implicit-subset processing order / single forward scan. So this comment /* Please added in order since this table is only run once time. */ really is misleading. "in order" doesn't quite get it, as apparently only forward references are permitted within the table. That then means that the patch needs to move up the whole Zv{b,k} group as well. Jan
On Fri, Jun 19, 2026 at 7:48 PM Jan Beulich <jbeulich@suse.com> wrote: > > The specification is quite explicit about this. OK, thanks. As for ... > Is the placement of "zve32x" after "zvbb" / "zvbc" actually correct? While > riscv_compare_subsets() indeed does a mere strcasecmp() past "zv", it > seems unlikely to be mere chance that Zve* come ahead of all other Zv* in > riscv_supported_std_z_ext[]. ... I checked the ISA spec again from here, https://github.com/riscv/riscv-isa-manual/blob/main/src/unpriv/naming.adoc#additional-standard-unprivileged-extension-names, "If multiple ext:z[] extensions are named, they should be ordered first by category, then alphabetically within a category — for example, Zicsr_Zifencei_Ztso" So I think since the alphabetical order, zve* should be placed after zvb*. The order of riscv_supported_* tables doesn't affect the final output, but it would be good to be maintained in the right order. Btw (not related to this patch), the spec also said "The name must end with an alphabetical character. The second letter from the end cannot be numeric if the last letter is p". I recall that some of the ratified extensions violate this rule by ending with a number, though I forget exactly which ones. In any case, unless the spec has been updated, I personally wouldn't want to see them forced into binutils... Thanks Nelson > > --- a/bfd/elfxx-riscv.c > +++ b/bfd/elfxx-riscv.c > @@ -1306,6 +1306,15 @@ static const struct riscv_implicit_subse > {"zvksc", "+zvks,+zvbc", check_implicit_always}, > {"zvks", "+zvksed,+zvksh,+zvkb,+zvkt", check_implicit_always}, > > + {"zvbc", "+zve32x", check_implicit_always}, > + {"zvkb", "+zve32x", check_implicit_always}, > + {"zvkg", "+zve32x", check_implicit_always}, > + {"zvkned", "+zve32x", check_implicit_always}, > + {"zvknha", "+zve32x", check_implicit_always}, > + {"zvknhb", "+zve32x", check_implicit_always}, > + {"zvksed", "+zve32x", check_implicit_always}, > + {"zvksh", "+zve32x", check_implicit_always}, > + > {"sdtrig", "+zicsr", check_implicit_always}, > > {"smaia", "+ssaia", check_implicit_always}, > --- a/gas/testsuite/gas/riscv/imply.d > +++ b/gas/testsuite/gas/riscv/imply.d > @@ -87,13 +87,13 @@ SYMBOL TABLE: > [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zk1p0_zkn1p0_zknd1p0_zkne1p0_zknh1p0_zkr1p0_zkt1p0 > [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zkn1p0_zknd1p0_zkne1p0_zknh1p0 > [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zks1p0_zksed1p0_zksh1p0 > -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbb1p0_zvkb1p0 > -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkg1p0_zvkn1p0_zvkned1p0_zvkng1p0_zvknhb1p0_zvkt1p0 > -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zvkb1p0_zvkn1p0_zvknc1p0_zvkned1p0_zvknhb1p0_zvkt1p0 > -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkn1p0_zvkned1p0_zvknhb1p0_zvkt1p0 > -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkg1p0_zvks1p0_zvksed1p0_zvksg1p0_zvksh1p0_zvkt1p0 > -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zvkb1p0_zvks1p0_zvksc1p0_zvksed1p0_zvksh1p0_zvkt1p0 > -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvks1p0_zvksed1p0_zvksh1p0_zvkt1p0 > +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbb1p0_zve32x1p0_zvkb1p0 > +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkg1p0_zvkn1p0_zvkned1p0_zvkng1p0_zvknhb1p0_zvkt1p0 > +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zve32x1p0_zvkb1p0_zvkn1p0_zvknc1p0_zvkned1p0_zvknhb1p0_zvkt1p0 > +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkn1p0_zvkned1p0_zvknhb1p0_zvkt1p0 > +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkg1p0_zvks1p0_zvksed1p0_zvksg1p0_zvksh1p0_zvkt1p0 > +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zve32x1p0_zvkb1p0_zvks1p0_zvksc1p0_zvksed1p0_zvksh1p0_zvkt1p0 > +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvks1p0_zvksed1p0_zvksh1p0_zvkt1p0 > [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_sdtrig1p0 > [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_smaia1p0_ssaia1p0 > [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_smcdeleg1p0_ssccfg1p0_sscsrind1p0 >
On 21.07.2026 04:24, Nelson Chu wrote: > On Fri, Jun 19, 2026 at 7:48 PM Jan Beulich <jbeulich@suse.com> wrote: >> >> The specification is quite explicit about this. > > OK, thanks. Hmm, thanks, but you giving an okay here contradicts what you say / quote below. (Plus, see below, the v3 arrangement is wrong anyway.) > As for ... > >> Is the placement of "zve32x" after "zvbb" / "zvbc" actually correct? While >> riscv_compare_subsets() indeed does a mere strcasecmp() past "zv", it >> seems unlikely to be mere chance that Zve* come ahead of all other Zv* in >> riscv_supported_std_z_ext[]. > > ... I checked the ISA spec again from here, > https://github.com/riscv/riscv-isa-manual/blob/main/src/unpriv/naming.adoc#additional-standard-unprivileged-extension-names, > > "If multiple ext:z[] extensions are named, they should be ordered > first by category, then alphabetically within a category — for > example, Zicsr_Zifencei_Ztso" > So I think since the alphabetical order, zve* should be placed after > zvb*. Well, first of all we need to heed the comment ahead of the table, no matter how cryptic / vague / ambiguous it is: /* Please added in order since this table is only run once time. */ zve* _must_ come after everything mentioning it as a dependency. Hence in v4 it now is: --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1239,11 +1239,30 @@ static const struct riscv_implicit_subse {"zvfhmin", "+zve32f", check_implicit_always}, {"zvfbfwma", "+zfbfmin,+zvfbfmin", check_implicit_always}, {"zvfbfmin", "+zve32f", check_implicit_always}, + + {"zvbb", "+zvkb", check_implicit_always}, + {"zvkng", "+zvkn,+zvkg", check_implicit_always}, + {"zvknc", "+zvkn,+zvbc", check_implicit_always}, + {"zvkn", "+zvkned,+zvknhb,+zvkb,+zvkt", check_implicit_always}, + {"zvksg", "+zvks,+zvkg", check_implicit_always}, + {"zvksc", "+zvks,+zvbc", check_implicit_always}, + {"zvks", "+zvksed,+zvksh,+zvkb,+zvkt", check_implicit_always}, + + {"zvbc", "+zve32x", check_implicit_always}, + {"zvkb", "+zve32x", check_implicit_always}, + {"zvkg", "+zve32x", check_implicit_always}, + {"zvkned", "+zve32x", check_implicit_always}, + {"zvknha", "+zve32x", check_implicit_always}, + {"zvknhb", "+zve32x", check_implicit_always}, + {"zvksed", "+zve32x", check_implicit_always}, + {"zvksh", "+zve32x", check_implicit_always}, + {"zve64d", "+d,+zve64f", check_implicit_always}, {"zve64f", "+zve32f,+zve64x,+zvl64b", check_implicit_always}, {"zve32f", "+f,+zve32x,+zvl32b", check_implicit_always}, {"zve64x", "+zve32x,+zvl64b", check_implicit_always}, {"zve32x", "+zvl32b,+zicsr", check_implicit_always}, + {"zvl65536b", "+zvl32768b", check_implicit_always}, {"zvl32768b", "+zvl16384b", check_implicit_always}, {"zvl16384b", "+zvl8192b", check_implicit_always}, @@ -1303,13 +1322,6 @@ static const struct riscv_implicit_subse {"zk", "+zkn,+zkr,+zkt", check_implicit_always}, {"zkn", "+zbkb,+zbkc,+zbkx,+zkne,+zknd,+zknh", check_implicit_always}, {"zks", "+zbkb,+zbkc,+zbkx,+zksed,+zksh", check_implicit_always}, - {"zvbb", "+zvkb", check_implicit_always}, - {"zvkng", "+zvkn,+zvkg", check_implicit_always}, - {"zvknc", "+zvkn,+zvbc", check_implicit_always}, - {"zvkn", "+zvkned,+zvknhb,+zvkb,+zvkt", check_implicit_always}, - {"zvksg", "+zvks,+zvkg", check_implicit_always}, - {"zvksc", "+zvks,+zvbc", check_implicit_always}, - {"zvks", "+zvksed,+zvksh,+zvkb,+zvkt", check_implicit_always}, {"sdtrig", "+zicsr", check_implicit_always}, This requirement also gets in the way of alphabetical sorting (e.g. zvknc has to come ahead of zvbc). Yet of course the term "category" is fuzzy as well. Given the v4 hunks above, what supposed order is it that you read out of the text you quote? What exactly are the "categories" specifically here? And then, is e.g. zk* coming after zv* correct? That's hard to tell already simply because there's V as an extension, but there's no K. Or is e.g. zicntr and zihpm living very early in the table not requiring not calling for zicfilp / zicfiss to move up as well? Or wouldn't zclsd then belong together with zcd and zcf? C / Zc* in particular mix pretty unhelpfully with other extensions, when it comes to determining "categories". > The order of riscv_supported_* tables doesn't affect the final > output, but it would be good to be maintained in the right order. Right, but that of riscv_implicit_subsets[] does. Jan
--- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1306,6 +1306,15 @@ static const struct riscv_implicit_subse {"zvksc", "+zvks,+zvbc", check_implicit_always}, {"zvks", "+zvksed,+zvksh,+zvkb,+zvkt", check_implicit_always}, + {"zvbc", "+zve32x", check_implicit_always}, + {"zvkb", "+zve32x", check_implicit_always}, + {"zvkg", "+zve32x", check_implicit_always}, + {"zvkned", "+zve32x", check_implicit_always}, + {"zvknha", "+zve32x", check_implicit_always}, + {"zvknhb", "+zve32x", check_implicit_always}, + {"zvksed", "+zve32x", check_implicit_always}, + {"zvksh", "+zve32x", check_implicit_always}, + {"sdtrig", "+zicsr", check_implicit_always}, {"smaia", "+ssaia", check_implicit_always}, --- a/gas/testsuite/gas/riscv/imply.d +++ b/gas/testsuite/gas/riscv/imply.d @@ -87,13 +87,13 @@ SYMBOL TABLE: [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zk1p0_zkn1p0_zknd1p0_zkne1p0_zknh1p0_zkr1p0_zkt1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zkn1p0_zknd1p0_zkne1p0_zknh1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zbkb1p0_zbkc1p0_zbkx1p0_zks1p0_zksed1p0_zksh1p0 -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbb1p0_zvkb1p0 -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkg1p0_zvkn1p0_zvkned1p0_zvkng1p0_zvknhb1p0_zvkt1p0 -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zvkb1p0_zvkn1p0_zvknc1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkn1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvkg1p0_zvks1p0_zvksed1p0_zvksg1p0_zvksh1p0_zvkt1p0 -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zvkb1p0_zvks1p0_zvksc1p0_zvksed1p0_zvksh1p0_zvkt1p0 -[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvkb1p0_zvks1p0_zvksed1p0_zvksh1p0_zvkt1p0 +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbb1p0_zve32x1p0_zvkb1p0 +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkg1p0_zvkn1p0_zvkned1p0_zvkng1p0_zvknhb1p0_zvkt1p0 +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zve32x1p0_zvkb1p0_zvkn1p0_zvknc1p0_zvkned1p0_zvknhb1p0_zvkt1p0 +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkn1p0_zvkned1p0_zvknhb1p0_zvkt1p0 +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvkg1p0_zvks1p0_zvksed1p0_zvksg1p0_zvksh1p0_zvkt1p0 +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zvbc1p0_zve32x1p0_zvkb1p0_zvks1p0_zvksc1p0_zvksed1p0_zvksh1p0_zvkt1p0 +[0-9a-f]+ l .text 0+000 \$xrv32i2p1_zve32x1p0_zvkb1p0_zvks1p0_zvksed1p0_zvksh1p0_zvkt1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_sdtrig1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_smaia1p0_ssaia1p0 [0-9a-f]+ l .text 0+000 \$xrv32i2p1_zicsr2p0_smcdeleg1p0_ssccfg1p0_sscsrind1p0