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 14043384D1A6 for ; Sat, 9 Jul 2022 03:50:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 14043384D1A6 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 608FC300089; Sat, 9 Jul 2022 03:50:27 +0000 (UTC) From: Tsukasa OI To: Tsukasa OI , Nelson Chu , Kito Cheng , Palmer Dabbelt Cc: binutils@sourceware.org Subject: [PATCH 1/2] RISC-V: Make `zip'/`unzip' on Zbkb non-aliases Date: Sat, 9 Jul 2022 12:50:14 +0900 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Sat, 09 Jul 2022 03:50:30 -0000 `zip'/`unzip' are specialized forms of `shfli'/`unshfli' instructions respectively. However, because both `shfli' and `unshfli' are not ratified (in generalized forms), disassembling `zip'/`unzip' on RV32_Zbkb with `-M no-aliases' option makes disassembly dumps with `.4byte' (an unrecognized instruction), not `zip'/`unzip'. This commit makes `zip'/`unzip' non-aliases until generalized forms of `shfli' and `unshfli' are ratified. gas/ChangeLog: * testsuite/gas/riscv/zbkb-32.d: Make sure that all instructions in RV32_Zbkb are non-aliases and disassembled correctly. opcodes/ChangeLog: * riscv-opc.c (riscv_opcodes): Make `zip'/`unzip' instructions on RV32_Zbkb non-aliases to fix a disassembler issue. --- gas/testsuite/gas/riscv/zbkb-32.d | 2 +- opcodes/riscv-opc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gas/testsuite/gas/riscv/zbkb-32.d b/gas/testsuite/gas/riscv/zbkb-32.d index c2718a0965a..c3fd09f9274 100644 --- a/gas/testsuite/gas/riscv/zbkb-32.d +++ b/gas/testsuite/gas/riscv/zbkb-32.d @@ -1,6 +1,6 @@ #as: -march=rv32i_zbkb #source: zbkb-32.s -#objdump: -d +#objdump: -d -M no-aliases .*:[ ]+file format .* diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c index 2f9945aa930..6c5b2eaf524 100644 --- a/opcodes/riscv-opc.c +++ b/opcodes/riscv-opc.c @@ -942,8 +942,8 @@ const struct riscv_opcode riscv_opcodes[] = {"cpopw", 64, INSN_CLASS_ZBB, "d,s", MATCH_CPOPW, MASK_CPOPW, match_opcode, 0 }, {"brev8", 32, INSN_CLASS_ZBKB, "d,s", MATCH_GREVI | MATCH_SHAMT_BREV8, MASK_GREVI | MASK_SHAMT, match_opcode, 0 }, {"brev8", 64, INSN_CLASS_ZBKB, "d,s", MATCH_GREVI | MATCH_SHAMT_BREV8, MASK_GREVI | MASK_SHAMT, match_opcode, 0 }, -{"zip", 32, INSN_CLASS_ZBKB, "d,s", MATCH_SHFLI|MATCH_SHAMT_ZIP_32, MASK_SHFLI|MASK_SHAMT, match_opcode, INSN_ALIAS }, -{"unzip", 32, INSN_CLASS_ZBKB, "d,s", MATCH_UNSHFLI|MATCH_SHAMT_ZIP_32, MASK_UNSHFLI|MASK_SHAMT, match_opcode, INSN_ALIAS }, +{"zip", 32, INSN_CLASS_ZBKB, "d,s", MATCH_SHFLI|MATCH_SHAMT_ZIP_32, MASK_SHFLI|MASK_SHAMT, match_opcode, 0 }, +{"unzip", 32, INSN_CLASS_ZBKB, "d,s", MATCH_UNSHFLI|MATCH_SHAMT_ZIP_32, MASK_UNSHFLI|MASK_SHAMT, match_opcode, 0 }, {"pack", 0, INSN_CLASS_ZBKB, "d,s,t", MATCH_PACK, MASK_PACK, match_opcode, 0 }, {"packh", 0, INSN_CLASS_ZBKB, "d,s,t", MATCH_PACKH, MASK_PACKH, match_opcode, 0 }, {"packw", 64, INSN_CLASS_ZBKB, "d,s,t", MATCH_PACKW, MASK_PACKW, match_opcode, 0 }, -- 2.34.1