From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id D289F385AE5A for ; Thu, 28 Jul 2022 11:46:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D289F385AE5A Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id C3166300089; Thu, 28 Jul 2022 11:46:54 +0000 (UTC) Message-ID: <287255b3-ab0c-1cf6-2681-e35fef1d8b05@irq.a4lg.com> Date: Thu, 28 Jul 2022 20:46:52 +0900 Mime-Version: 1.0 Subject: Re: [PATCH 0/1] RISC-V: Add `OP_V' to .insn named opcodes Content-Language: en-US To: Nelson Chu , Kito Cheng , Palmer Dabbelt Cc: binutils@sourceware.org References: From: Tsukasa OI In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2022 11:47:01 -0000 Ping. I noticed that LLVM (14 or later) already implements this named opcode. sample.s: .attribute arch, "rv64gcv" # Both vadd.vv v1,v2,v3 .insn r 0x57, 0, 1, x1, x3, x2 .insn r OP_V, 0, 1, x1, x3, x2 $ llvm-mc -filetype=obj -triple=riscv64 -o sample.o sample.s $ riscv64-unknown-elf-objdump -d sample.o (...) 0000000000000000 <.text>: 0: 022180d7 vadd.vv v1,v2,v3 4: 022180d7 vadd.vv v1,v2,v3 Even after this patch, following assembly file generates an error (unlike LLVM). I'm going to raise an issue later. sample2.s: .attribute arch, "rv64gcv" # vadd.vv v1,v2,v3 (okay on LLVM but error on Binutils) .insn r OP_V, 0, 1, v1, v3, v2 Thanks, Tsukasa On 2022/07/09 12:51, Tsukasa OI wrote: > Hello, > > This small patch adds OP_V to named opcode list for .insn directive. > > Tracker on GitHub: > > > Sidenote: > I started listing my Binutils submissions on my GitHub Wiki: > > hoping that current status and conflicting patches are clear. > > > OP-V (0x57) is an opcode for vector instructions (defined on now > ratified V extension). It adds OP_V to named constants of .insn directive > (note that replacing - with _ is standard on GNU Binutils' .insn). > > Although vector instruction encoding is not implemented in .insn directive, > it will help future implementation of custom vector .insn. > > If Zp* extensions are ratified, we could add OP_P (0x77) likewise. > > > Thanks, > Tsukasa > > > > > Tsukasa OI (1): > RISC-V: Add `OP_V' to .insn named opcodes > > gas/config/tc-riscv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > > base-commit: d2acd4b0c5bab349aaa152d60268bc144634a844