| Message ID | 1a57710b-44d4-4852-91b1-01665b8f383c@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 CEAA24BAD17F for <patchwork@sourceware.org>; Fri, 19 Jun 2026 11:48:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CEAA24BAD17F 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=AaS/8KH+ X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 937D04B9DB7C for <binutils@sourceware.org>; Fri, 19 Jun 2026 11:47:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 937D04B9DB7C 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 937D04B9DB7C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781869663; cv=none; b=NNsDjudu/J2xb9L2F6cImCK4+rgIkUE6hNgJDmARpRozCr998NnffKy8C42MPEgM8ETvLScg2rQ934CIQ1ZiO3VESLTuj9TIpWthM0YKmnEwmHRCkiQRP7m/APqSVhdRA5dQVn9HNEfG3ZO4J7XLXRtIFIHlDjViPi40Be2xC6A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781869663; c=relaxed/simple; bh=RGT2dYHkNJ1Dwo8wV1H5A0BoKejRYsFu29chASsqt+M=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=bhNrR9UsXtj484+pbI3Xyy3hSyCFFrNcPfdoMu6HgO4mnf1YWE5UtM6RClCVES6pAV9JXkhwrgTGmmVaurcnuP36SHoUF/15zeBMCZmozsOvjnCdN7ZlECXoKpTzTDlk642MSv6f9UlDgyJQ+gh0EEI+2DCkkldXe7G5EyRy2U4= 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=AaS/8KH+ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 937D04B9DB7C Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4921e4dd62dso15258365e9.0 for <binutils@sourceware.org>; Fri, 19 Jun 2026 04:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1781869662; x=1782474462; 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=MVlzDfvhglyHbqO1ZtedpUrhIwa5/bGKUttd4/32Opk=; b=AaS/8KH+mHTNEgJ+hQgx0KnOtAzpaQaVnL6KEY8WNd8s93yqH+BTgTK6q4i6mXSVWQ yCmuj6iilI8dETU0OC4qg0FCrFtlfHjiTi5QLBl3ORMnMaPb4gcVBZDSLlu5s4rfkMDW u+Z2ih7J7DjzF1FS+ETLCnEk/by1t/wBthUu5U9cfhkMERwbaZHx2rf90Mv1SGg95m0p pkqQnc5lDeCdu+OQ4E4f8L+oRnNjaEjbUbwTzgqFMmGJzX10auFb95bhxWtEvTD7vhyH jEyGB8zpnDkBRd8e77lmbl20XEbmQ/xo9iiqhZDvtRlscNdTIs0A5GEfgXTu40T00lYb X5Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781869662; x=1782474462; 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=MVlzDfvhglyHbqO1ZtedpUrhIwa5/bGKUttd4/32Opk=; b=RyivMbq+ZxmIh01Q/S9OoJuxlQXsf6k1AytDBJ5QZ1j3YvI7vxHMn8aiKh91TNnRUM gW+/mMxoI/+ua1RnYIO5ctZ8mgrqL9ug5YX01W4HRl5EQ6Lo159S/7xDW44cnhQPjo++ IzGAIvfWHK5oBGI5VxHoQyDqJmnmXkZiTe3XmWCjoK+UkZXQNHFl+CaFtAh2YG4WzsDK VH0NoVJr+gfqgOCj6cMYPNhjbiBu/SAKn5/0XZ5vG/opy0o/LKAYB5Qd6jbJt6XJ87Dy 5+UC1HYgauQ8KfkV2bdzsBRKXzGAkWVSbtwTuVIQEdFIIyRAxIx7QfmlE+41Lc/sI1MP DBLA== X-Gm-Message-State: AOJu0YxCTIMuLdVs7hB6tAOUHAyfIjFlT/OIN1GcFBNQJ5lKYyUaS0yl XqeU7N3RBltTEa2ilurWD0054CcHO+6VVpMBE3x3TLeW5aAXMbLqTtUz7IWIJlX4Tki8wDSacR3 xKYGqvA== X-Gm-Gg: AfdE7cmq/x+ldgZBtvRxlDe/xrNi5H6wkF5k4pR9ZNY60LXzKdfDagTM9GMMnTaRuYm xKrpCkqZh4Ac9BVvF3fGy4J+6thhU70eZzRITLtNisyj9GNed518xCIKslGhPVa6JDE8ZPZGEU4 jmms9ib80VtQSqxVdYfT0qG804dDM6gHhDluMuytzmaD+Ot61ol9wQFsvID3JOFnv8iYJAkqZKW S2XoZd9jDzNsvaneYRAQne/yQV1VODnWuepBcr1qiNcqaJv1bc3MAmEHpTFwWFbVjQRGkuea0eU mcTa2S1VFdZb95j9yJNhoIqO+UBUqmhxaONeQx2TeBujHH2DIVblu3sRwKPghtKDFSx0pRzfLI8 5WyN4ChUbAHcT8zCPRr9mzH7K2lpPc2Df9g2rUSVTRR0SScI48LP2zvdFIz7LooeSG2TQp+dycm JflFP0L53aPjEhxbKmx/SHa18GJPFhitQ+AgmrjVRRxcNNujEeFW+Ned4esNCvASEvgA+TZry2F lky X-Received: by 2002:a05:600d:84ca:10b0:490:e180:2e0 with SMTP id 5b1f17b1804b1-492409fbfb9mr28960935e9.3.1781869662465; Fri, 19 Jun 2026 04:47:42 -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 5b1f17b1804b1-49245711032sm17988995e9.0.2026.06.19.04.47.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Jun 2026 04:47:42 -0700 (PDT) Message-ID: <1a57710b-44d4-4852-91b1-01665b8f383c@suse.com> Date: Fri, 19 Jun 2026 13:47:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v3 02/13] RISC-V: EEW64 checking 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 O9Hf9XBmK0uE9IgMaiCp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HGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+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:47 a.m. UTC
Like the assembler, the disassembler should also use the INSN_V_EEW64 flag. Respectively marked insns shouldn't be disassembled normally when Zve64x isn't enabled. While there also drop the redundant Zve32x check from gas: All affected insns are INSN_CLASS_V, which means Zve32x was already checked to be enabled (both V and Zve64x imply Zve32x). --- Question is why a flag was used in the first place: The property could be expressed by a new INSN_CLASS_ZVE64X, couldn't it?
Comments
On Fri, Jun 19, 2026 at 7:47 PM Jan Beulich <jbeulich@suse.com> wrote: > > Like the assembler, the disassembler should also use the INSN_V_EEW64 > flag. Respectively marked insns shouldn't be disassembled normally when > Zve64x isn't enabled. > > While there also drop the redundant Zve32x check from gas: All affected > insns are INSN_CLASS_V, which means Zve32x was already checked to be > enabled (both V and Zve64x imply Zve32x). make sense. > Question is why a flag was used in the first place: The property could be > expressed by a new INSN_CLASS_ZVE64X, couldn't it? I forgot, probably just because people argued they want to dis-assembler old objects for segment load/store with EEW64 but without zve64x since this check may be added later that, but it doesn't matter now. I think using a new INSN_CLASS_ZVE64X should be the right way to go. Thanks Nelson > --- a/gas/config/tc-riscv.c > +++ b/gas/config/tc-riscv.c > @@ -2964,10 +2964,9 @@ riscv_ip (char *str, struct riscv_cl_ins > insn_with_csr = false; > } > > - /* The (segmant) load and store with EEW 64 cannot be used > + /* The (segment) load and store with EEW 64 cannot be used > when zve32x is enabled. */ > - if (ip->insn_mo->pinfo & INSN_V_EEW64 > - && riscv_subset_supports (&riscv_rps_as, "zve32x") > + if ((ip->insn_mo->pinfo & INSN_V_EEW64) > && !riscv_subset_supports (&riscv_rps_as, "zve64x")) > { > error.msg = _("illegal opcode for zve32x"); > --- a/opcodes/riscv-dis.c > +++ b/opcodes/riscv-dis.c > @@ -1018,10 +1018,16 @@ riscv_disassemble_insn (bfd_vma memaddr, > && (op->xlen_requirement != pd->xlen)) > continue; > /* Is this instruction supported by the current architecture? */ > - if (!pd->all_ext > - && !riscv_multi_subset_supports (&pd->riscv_rps_dis, > - op->insn_class)) > - continue; > + if (!pd->all_ext) > + { > + if (!riscv_multi_subset_supports (&pd->riscv_rps_dis, > + op->insn_class)) > + continue; > + > + if ((op->pinfo & INSN_V_EEW64) > + && !riscv_subset_supports (&pd->riscv_rps_dis, "zve64x")) > + continue; > + } > > /* It's a match. */ > (*info->fprintf_styled_func) (info->stream, dis_style_mnemonic, > --- /dev/null > +++ b/gas/testsuite/gas/riscv/eew64.d > @@ -0,0 +1,13 @@ > +#as: -march=rv32i > +#objdump: -d > + > +.*:[ ]+file format .* > + > +Disassembly of section .text: > + > +0+000 <eew32>: > +[ ]+0:[ ]+020ff007[ ]+\.insn[ ]+4, ?0x020ff007 > + > +0+004 <eew64>: > +[ ]+4:[ ]+020ff007[ ]+vle64\.v[ ]+v0,\(t6\) > +#pass > --- /dev/null > +++ b/gas/testsuite/gas/riscv/eew64.s > @@ -0,0 +1,12 @@ > + .option arch, rv32i > + .option arch, +zve32x > + > +eew32: > + # vle64.v v0, (x31) > + .insn 4, 0x020ff007 > + > + .option arch, rv32i > + .option arch, +zve64x > + > +eew64: > + vle64.v v0, (x31) >
On 21.07.2026 03:30, Nelson Chu wrote: > On Fri, Jun 19, 2026 at 7:47 PM Jan Beulich <jbeulich@suse.com> wrote: >> >> Like the assembler, the disassembler should also use the INSN_V_EEW64 >> flag. Respectively marked insns shouldn't be disassembled normally when >> Zve64x isn't enabled. >> >> While there also drop the redundant Zve32x check from gas: All affected >> insns are INSN_CLASS_V, which means Zve32x was already checked to be >> enabled (both V and Zve64x imply Zve32x). > > make sense. > >> Question is why a flag was used in the first place: The property could be >> expressed by a new INSN_CLASS_ZVE64X, couldn't it? > > I forgot, probably just because people argued they want to > dis-assembler old objects for segment load/store with EEW64 but > without zve64x since this check may be added later that, but it > doesn't matter now. I think using a new INSN_CLASS_ZVE64X should be > the right way to go. Okay, I'll make a follow-on patch then. Jan
--- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -2964,10 +2964,9 @@ riscv_ip (char *str, struct riscv_cl_ins insn_with_csr = false; } - /* The (segmant) load and store with EEW 64 cannot be used + /* The (segment) load and store with EEW 64 cannot be used when zve32x is enabled. */ - if (ip->insn_mo->pinfo & INSN_V_EEW64 - && riscv_subset_supports (&riscv_rps_as, "zve32x") + if ((ip->insn_mo->pinfo & INSN_V_EEW64) && !riscv_subset_supports (&riscv_rps_as, "zve64x")) { error.msg = _("illegal opcode for zve32x"); --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -1018,10 +1018,16 @@ riscv_disassemble_insn (bfd_vma memaddr, && (op->xlen_requirement != pd->xlen)) continue; /* Is this instruction supported by the current architecture? */ - if (!pd->all_ext - && !riscv_multi_subset_supports (&pd->riscv_rps_dis, - op->insn_class)) - continue; + if (!pd->all_ext) + { + if (!riscv_multi_subset_supports (&pd->riscv_rps_dis, + op->insn_class)) + continue; + + if ((op->pinfo & INSN_V_EEW64) + && !riscv_subset_supports (&pd->riscv_rps_dis, "zve64x")) + continue; + } /* It's a match. */ (*info->fprintf_styled_func) (info->stream, dis_style_mnemonic, --- /dev/null +++ b/gas/testsuite/gas/riscv/eew64.d @@ -0,0 +1,13 @@ +#as: -march=rv32i +#objdump: -d + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 <eew32>: +[ ]+0:[ ]+020ff007[ ]+\.insn[ ]+4, ?0x020ff007 + +0+004 <eew64>: +[ ]+4:[ ]+020ff007[ ]+vle64\.v[ ]+v0,\(t6\) +#pass --- /dev/null +++ b/gas/testsuite/gas/riscv/eew64.s @@ -0,0 +1,12 @@ + .option arch, rv32i + .option arch, +zve32x + +eew32: + # vle64.v v0, (x31) + .insn 4, 0x020ff007 + + .option arch, rv32i + .option arch, +zve64x + +eew64: + vle64.v v0, (x31)