From patchwork Thu Jun 29 16:34:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WANG Xuerui X-Patchwork-Id: 114357 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9764855vqr; Thu, 29 Jun 2023 09:36:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlH4g50ljLz4wrpToHZfwT7yXKFK5U1Fka47pUxh7Ct2DT1ZRsOmYMKnNWq2faX4TrFy5KT7 X-Received: by 2002:a17:906:d190:b0:991:f586:7c6a with SMTP id c16-20020a170906d19000b00991f5867c6amr494911ejz.13.1688056568087; Thu, 29 Jun 2023 09:36:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688056568; cv=none; d=google.com; s=arc-20160816; b=eCnOwfmLIFg73o83ixt4vky9vCvURwu6bNbq0/x7ZId3ewyDn1I7LQQ5//OTBGuFSZ Mu2GViDtE+pBB/Nhulvs0APzu2XE7ahY3M/rrnhGkPgBPHq1WasWgYNcAkLTYnMWZNQ/ GUrc0HZBl5u/5q401FlM9q/kTwKpDI06U3Sru5FVkRmI7vhdUWEbhw8yItdxNaLZOMH+ kWNbYLkQR4lpeLuT+RtE6P2U9GVAJV6jNsAYDM9wdKR/VaZmfhuei3tKEmlgUJUVrwEn kM1l+caXjCig2dCnycI9Jkm/hqWUu4YVcCQSVZIHro9ys7ePic/oQfRTA4EC5OfbJpa/ br2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=WerNzUMsLiwirncyzVqDt6VUsLwihWLvL4U1xna/TCY=; fh=F52lMKP/ag7PTpjpGsg79bnedhkoffS1BBUct4g/1x0=; b=vyO5DcnYOlffJ6e/rk4ryKTCfUF0mwCIPZtkDhyEjUQz51LyvXlxzPCUdSUCD7qmg5 jreYCTvJJznlEMw3SnJdiB4j2NBVVVLPZBlPHyfUrGSDkmf+NAj9iCuavOj/uC8m9iwR uEYlN+ge9ZJ3ef8ux1hbIVWjXkbM0f5W2mHdzuZA916ErvhRI34jYN2XQYF8JiRXBMGO dFW4Tx7x0ApFub3fFSDAtFEZ0VF8a1R2kdlySojBxJtim5kNfHrwUU6v3+ZgOFcFowDU 9UB8LwE7FSddAmwh8BARvjS4O2sQakAfelf0K6/UjBIerra6TXl5GjLtBIgsyXwrH01P RzsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=DI9uhQU7; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id bm6-20020a170906c04600b00982a36463c9si7277541ejb.518.2023.06.29.09.36.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 09:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=DI9uhQU7; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C2E73857340 for ; Thu, 29 Jun 2023 16:35:53 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by sourceware.org (Postfix) with ESMTPS id D35173858D39 for ; Thu, 29 Jun 2023 16:35:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D35173858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=xen0n.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xen0n.name DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1688056510; bh=z4/j7FGLPhx8ecBLvDbLiGkXH0wVTq/zCntSV3jeTds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DI9uhQU7c4umBtc1bQrBRH8+IjiYPspnex79aQOAJZ2k/yCz4uvB2RK6d0JMKoPrv N9Vmdkb+/1hLcfvfdK6w2/GcdXEOe8oYvo2de0V2s2UDdYHRfosgtq1VgchWBbdkJc fdcBd5qvI61oBPQT/TEgxdbAWnVNNUQdw4am9EKg= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 2672860148; Fri, 30 Jun 2023 00:35:10 +0800 (CST) From: WANG Xuerui To: binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , Lulu Cheng , Fangrui Song , Xi Ruoyao , WANG Xuerui Subject: [PATCH v7 1/7] LoongArch: support disassembling certain pseudo-instructions Date: Fri, 30 Jun 2023 00:34:58 +0800 Message-Id: <20230629163504.1331025-2-i.swmail@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230629163504.1331025-1-i.swmail@xen0n.name> References: <20230629163504.1331025-1-i.swmail@xen0n.name> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770055604025012417?= X-GMAIL-MSGID: =?utf-8?q?1770055604025012417?= From: WANG Xuerui Add a flag in the pinfo field for being able to mark certain specialized matchers as disassembler-only, so some degree of isolation between assembler-side and disassembler-side can be achieved. This isolation is necessary, firstly because some pseudo-instructions cannot be fully described in the opcode table, like `li.[wd]`, so the corresponding opcode entry cannot have meaningful match/mask values. Secondly, some of these pseudo-instructions can be realized in more than one plausible ways; e.g. `li.w rd, ` can be realized on LA64 with any of `addi.w`, `addi.d` or `ori`. If we tie disassembly of such aliases with the corresponding GAS support, only one canonical form among the above would be recognized as `li.w`, and it would mildly impact the readability of disassembly output. People wanting the exact disassembly can always set `-M no-aliases` to get the original behavior back. In addition, in certain cases, information is irreversibly lost after assembling, so perfect round-trip would not be possible in such cases. For example, `li.w` and `li.d` of immediates within int32_t range produce the same code; in this patch, `addi.d rd, $zero, imm` is treated as `li.d`, while `addi.w` and `ori` immediate loads are shown as `li.w`, due to the expressible value range well within 32 bits. gas/ChangeLog: * config/tc-loongarch.c (get_loongarch_opcode): Ignore disassembler-only aliases. * testsuite/gas/loongarch/64_pcrel.d: Update test case. * testsuite/gas/loongarch/imm_ins.d: Likewise. * testsuite/gas/loongarch/imm_ins_32.d: Likewise. * testsuite/gas/loongarch/jmp_op.d: Likewise. * testsuite/gas/loongarch/li.d: Likewise. * testsuite/gas/loongarch/macro_op.d: Likewise. * testsuite/gas/loongarch/macro_op_32.d: Likewise. * testsuite/gas/loongarch/macro_op_large_abs.d: Likewise. * testsuite/gas/loongarch/macro_op_large_pc.d: Likewise. * testsuite/gas/loongarch/nop.d: Likewise. * testsuite/gas/loongarch/relax_align.d: Likewise. * testsuite/gas/loongarch/reloc.d: Likewise. include/ChangeLog: * opcode/loongarch.h (INSN_DIS_ALIAS): Add. ld/ChangeLog: * testsuite/ld-loongarch-elf/jmp_op.d: Update test case. * testsuite/ld-loongarch-elf/macro_op.d: Likewise. * testsuite/ld-loongarch-elf/macro_op_32.d: Likewise. * testsuite/ld-loongarch-elf/relax-align.dd: Likewise. opcodes/ChangeLog: * loongarch-dis.c: Move register name map declarations to top. (get_loongarch_opcode_by_binfmt): Consider aliases when disassembling without the no-aliases option. (parse_loongarch_dis_option): Support the no-aliases option. * loongarch-opc.c: Collect pseudo instructions into a new dedicated table. Signed-off-by: WANG Xuerui --- gas/config/tc-loongarch.c | 3 ++- gas/testsuite/gas/loongarch/64_pcrel.d | 2 +- gas/testsuite/gas/loongarch/imm_ins.d | 4 +-- gas/testsuite/gas/loongarch/imm_ins_32.d | 2 +- gas/testsuite/gas/loongarch/jmp_op.d | 12 ++++----- gas/testsuite/gas/loongarch/li.d | 8 +++--- gas/testsuite/gas/loongarch/macro_op.d | 4 +-- gas/testsuite/gas/loongarch/macro_op_32.d | 4 +-- .../gas/loongarch/macro_op_large_abs.d | 12 ++++----- .../gas/loongarch/macro_op_large_pc.d | 12 ++++----- gas/testsuite/gas/loongarch/nop.d | 2 +- gas/testsuite/gas/loongarch/relax_align.d | 6 ++--- gas/testsuite/gas/loongarch/reloc.d | 2 +- include/opcode/loongarch.h | 2 ++ ld/testsuite/ld-loongarch-elf/jmp_op.d | 2 +- ld/testsuite/ld-loongarch-elf/macro_op.d | 24 ++++++++--------- ld/testsuite/ld-loongarch-elf/macro_op_32.d | 4 +-- ld/testsuite/ld-loongarch-elf/relax-align.dd | 4 +-- opcodes/loongarch-dis.c | 26 ++++++++++++------- opcodes/loongarch-opc.c | 23 ++++++++++++++-- 20 files changed, 94 insertions(+), 64 deletions(-) diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index 7366e766a49..6e8aa35e282 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -802,7 +802,8 @@ get_loongarch_opcode (struct loongarch_cl_insn *insn) for (it = ase->opcodes; it->name; it++) { if ((!it->include || (it->include && *it->include)) - && (!it->exclude || (it->exclude && !(*it->exclude)))) + && (!it->exclude || (it->exclude && !(*it->exclude))) + && !(it->pinfo & INSN_DIS_ALIAS)) str_hash_insert (ase->name_hash_entry, it->name, (void *) it, 0); } diff --git a/gas/testsuite/gas/loongarch/64_pcrel.d b/gas/testsuite/gas/loongarch/64_pcrel.d index 6d4654b795e..66b80a397fa 100644 --- a/gas/testsuite/gas/loongarch/64_pcrel.d +++ b/gas/testsuite/gas/loongarch/64_pcrel.d @@ -7,5 +7,5 @@ Disassembly of section .text: 00000000.* <.text>: -[ ]+0:[ ]+03400000[ ]+andi[ ]+\$zero,[ ]+\$zero,[ ]+0x0 +[ ]+0:[ ]+03400000[ ]+nop[ ]+ [ ]+0:[ ]+R_LARCH_64_PCREL[ ]+\*ABS\* diff --git a/gas/testsuite/gas/loongarch/imm_ins.d b/gas/testsuite/gas/loongarch/imm_ins.d index 0ceaead3edf..c588b5e0e25 100644 --- a/gas/testsuite/gas/loongarch/imm_ins.d +++ b/gas/testsuite/gas/loongarch/imm_ins.d @@ -8,10 +8,10 @@ Disassembly of section .text: 00000000.* <.text>: -[ ]+0:[ ]+03848c0c[ ]+ori[ ]+\$t0,[ ]+\$zero,[ ]+0x123 +[ ]+0:[ ]+03848c0c[ ]+li.w[ ]+\$t0,[ ]+0x123 [ ]+4:[ ]+15ffe00d[ ]+lu12i.w[ ]+\$t1,[ ]+-256\(0xfff00\) [ ]+8:[ ]+16001fed[ ]+lu32i.d[ ]+\$t1,[ ]+255\(0xff\) -[ ]+c:[ ]+02bffc0e[ ]+addi.w[ ]+\$t2,[ ]+\$zero,[ ]+-1\(0xfff\) +[ ]+c:[ ]+02bffc0e[ ]+li.w[ ]+\$t2,[ ]+-1\(0xfff\) [ ]+10:[ ]+1601ffee[ ]+lu32i.d[ ]+\$t2,[ ]+4095\(0xfff\) [ ]+14:[ ]+0004b58b[ ]+alsl.w[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 [ ]+18:[ ]+0006b58b[ ]+alsl.wu[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 diff --git a/gas/testsuite/gas/loongarch/imm_ins_32.d b/gas/testsuite/gas/loongarch/imm_ins_32.d index 0a826bfba5b..5fd5835a342 100644 --- a/gas/testsuite/gas/loongarch/imm_ins_32.d +++ b/gas/testsuite/gas/loongarch/imm_ins_32.d @@ -8,7 +8,7 @@ Disassembly of section .text: 00000000.* <.text>: -[ ]+0:[ ]+03848c0c[ ]+ori[ ]+\$t0,[ ]+\$zero,[ ]+0x123 +[ ]+0:[ ]+03848c0c[ ]+li.w[ ]+\$t0,[ ]+0x123 [ ]+4:[ ]+0004b58b[ ]+alsl.w[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 [ ]+8:[ ]+0006b58b[ ]+alsl.wu[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 [ ]+c:[ ]+0009358b[ ]+bytepick.w[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 diff --git a/gas/testsuite/gas/loongarch/jmp_op.d b/gas/testsuite/gas/loongarch/jmp_op.d index a4535c297c9..0ce804b831c 100644 --- a/gas/testsuite/gas/loongarch/jmp_op.d +++ b/gas/testsuite/gas/loongarch/jmp_op.d @@ -7,12 +7,12 @@ Disassembly of section .text: 00000000.* <.L1>: -[ ]+0:[ ]+03400000[ ]+andi[ ]+\$zero,[ ]+\$zero,[ ]+0x0 -[ ]+4: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]+24:[ ]+R_LARCH_B26[ ]+\.L1 [ ]+28:[ ]+57ffdbff[ ]+bl[ ]+-40\(0xfffffd8\)[ ]+#[ ]+0[ ]+<\.L1> @@ -47,4 +47,4 @@ Disassembly of section .text: [ ]+4c:[ ]+R_LARCH_B16[ ]+\.L1 [ ]+50:[ ]+6fffb0a4[ ]+bgeu[ ]+\$a1,[ ]+\$a0,[ ]+-80\(0x3ffb0\)[ ]+#[ ]+0[ ]+<\.L1> [ ]+50:[ ]+R_LARCH_B16[ ]+\.L1 -[ ]+54:[ ]+4c000020[ ]+jirl[ ]+\$zero,[ ]+\$ra,[ ]+0 +[ ]+54:[ ]+4c000020[ ]+ret[ ]+ diff --git a/gas/testsuite/gas/loongarch/li.d b/gas/testsuite/gas/loongarch/li.d index 2b37784f237..6f5bcd1dcb3 100644 --- a/gas/testsuite/gas/loongarch/li.d +++ b/gas/testsuite/gas/loongarch/li.d @@ -8,16 +8,16 @@ Disassembly of section .text: 00000000.* <_start>: -[ ]+0:[ ]+03803c06[ ]+ori[ ]+\$a2,[ ]+\$zero,[ ]+0xf +[ ]+0:[ ]+03803c06[ ]+li\.w[ ]+\$a2,[ ]+0xf [ ]+4:[ ]+1a000005[ ]+pcalau12i[ ]+\$a1,[ ]+0 [ ]+4:[ ]+R_LARCH_PCALA_HI20[ ]+msg [ ]+4:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+8:[ ]+02c000a5[ ]+addi\.d[ ]+\$a1,[ ]+\$a1,[ ]+0 [ ]+8:[ ]+R_LARCH_PCALA_LO12[ ]+msg [ ]+8:[ ]+R_LARCH_RELAX[ ]+\*ABS\* -[ ]+c:[ ]+03800404[ ]+ori[ ]+\$a0,[ ]+\$zero,[ ]+0x1 -[ ]+10:[ ]+0381000b[ ]+ori[ ]+\$a7,[ ]+\$zero,[ ]+0x40 +[ ]+c:[ ]+03800404[ ]+li\.w[ ]+\$a0,[ ]+0x1 +[ ]+10:[ ]+0381000b[ ]+li\.w[ ]+\$a7,[ ]+0x40 [ ]+14:[ ]+002b0000[ ]+syscall[ ]+0x0 [ ]+18:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+1c:[ ]+0381740b[ ]+ori[ ]+\$a7,[ ]+\$zero,[ ]+0x5d +[ ]+1c:[ ]+0381740b[ ]+li\.w[ ]+\$a7,[ ]+0x5d [ ]+20:[ ]+002b0000[ ]+syscall[ ]+0x0 diff --git a/gas/testsuite/gas/loongarch/macro_op.d b/gas/testsuite/gas/loongarch/macro_op.d index 3465d11d50d..3f6518eddb0 100644 --- a/gas/testsuite/gas/loongarch/macro_op.d +++ b/gas/testsuite/gas/loongarch/macro_op.d @@ -9,9 +9,9 @@ Disassembly of section .text: 00000000.* <.text>: [ ]+0:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+4:[ ]+02bffc04[ ]+addi\.w[ ]+\$a0,[ ]+\$zero,[ ]+-1\(0xfff\) +[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) [ ]+8:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+c:[ ]+02bffc04[ ]+addi\.w[ ]+\$a0,[ ]+\$zero,[ ]+-1\(0xfff\) +[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) [ ]+10:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+10:[ ]+R_LARCH_GOT_PC_HI20[ ]+\.L1 [ ]+10:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/gas/testsuite/gas/loongarch/macro_op_32.d b/gas/testsuite/gas/loongarch/macro_op_32.d index f5a2b54dd9b..5ac15fdfea8 100644 --- a/gas/testsuite/gas/loongarch/macro_op_32.d +++ b/gas/testsuite/gas/loongarch/macro_op_32.d @@ -9,9 +9,9 @@ Disassembly of section .text: 00000000.* <.L1>: [ ]+0:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+4:[ ]+02bffc04[ ]+addi.w[ ]+\$a0,[ ]+\$zero,[ ]+-1\(0xfff\) +[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) [ ]+8:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+c:[ ]+02bffc04[ ]+addi.w[ ]+\$a0,[ ]+\$zero,[ ]+-1\(0xfff\) +[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) [ ]+10:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+10:[ ]+R_LARCH_GOT_PC_HI20[ ]+.L1 [ ]+10:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/gas/testsuite/gas/loongarch/macro_op_large_abs.d b/gas/testsuite/gas/loongarch/macro_op_large_abs.d index f3a3a4845b9..0c49f68e2ab 100644 --- a/gas/testsuite/gas/loongarch/macro_op_large_abs.d +++ b/gas/testsuite/gas/loongarch/macro_op_large_abs.d @@ -11,7 +11,7 @@ Disassembly of section .text: [ ]+0:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+0:[ ]+R_LARCH_PCALA_HI20[ ]+.L1 [ ]+0:[ ]+R_LARCH_RELAX[ ]+\*ABS\* -[ ]+4:[ ]+02c00005[ ]+addi.d[ ]+\$a1,[ ]+\$zero,[ ]+0 +[ ]+4:[ ]+02c00005[ ]+li\.d[ ]+\$a1,[ ]+0 [ ]+4:[ ]+R_LARCH_PCALA_LO12[ ]+.L1 [ ]+4:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+8:[ ]+16000005[ ]+lu32i.d[ ]+\$a1,[ ]+0 @@ -31,7 +31,7 @@ Disassembly of section .text: [ ]+24:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+24:[ ]+R_LARCH_PCALA_HI20[ ]+.L1 [ ]+24:[ ]+R_LARCH_RELAX[ ]+\*ABS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]+\$a1 [ ]+68:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+68:[ ]+R_LARCH_TLS_LD_PC_HI20[ ]+TLS1 -[ ]+6c:[ ]+02c00005[ ]+addi.d[ ]+\$a1,[ ]+\$zero,[ ]+0 +[ ]+6c:[ ]+02c00005[ ]+li\.d[ ]+\$a1,[ ]+0 [ ]+6c:[ ]+R_LARCH_GOT_PC_LO12[ ]+TLS1 [ ]+6c:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+70:[ ]+16000005[ ]+lu32i.d[ ]+\$a1,[ ]+0 @@ -75,7 +75,7 @@ Disassembly of section .text: [ ]+78:[ ]+00109484[ ]+add.d[ ]+\$a0,[ ]+\$a0,[ ]+\$a1 [ ]+7c:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+7c:[ ]+R_LARCH_TLS_GD_PC_HI20[ ]+TLS1 -[ ]+80:[ ]+02c00005[ ]+addi.d[ ]+\$a1,[ ]+\$zero,[ ]+0 +[ ]+80:[ ]+02c00005[ ]+li\.d[ ]+\$a1,[ ]+0 [ ]+80:[ ]+R_LARCH_GOT_PC_LO12[ ]+TLS1 [ ]+80:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+84:[ ]+16000005[ ]+lu32i.d[ ]+\$a1,[ ]+0 diff --git a/gas/testsuite/gas/loongarch/macro_op_large_pc.d b/gas/testsuite/gas/loongarch/macro_op_large_pc.d index f3a3a4845b9..0c49f68e2ab 100644 --- a/gas/testsuite/gas/loongarch/macro_op_large_pc.d +++ b/gas/testsuite/gas/loongarch/macro_op_large_pc.d @@ -11,7 +11,7 @@ Disassembly of section .text: [ ]+0:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+0:[ ]+R_LARCH_PCALA_HI20[ ]+.L1 [ ]+0:[ ]+R_LARCH_RELAX[ ]+\*ABS\* -[ ]+4:[ ]+02c00005[ ]+addi.d[ ]+\$a1,[ ]+\$z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as/testsuite/gas/loongarch/nop.d index 4cdcc5ce0d2..222456e8b8c 100644 --- a/gas/testsuite/gas/loongarch/nop.d +++ b/gas/testsuite/gas/loongarch/nop.d @@ -7,4 +7,4 @@ Disassembly of section .text: 0+000 : -[ ]+0:[ ]+03400000[ ]+andi[ ]+\$zero, \$zero, 0x0 +[ ]+0:[ ]+03400000[ ]+nop[ ]+ diff --git a/gas/testsuite/gas/loongarch/relax_align.d b/gas/testsuite/gas/loongarch/relax_align.d index 8a44573d406..1810eb4cae7 100644 --- a/gas/testsuite/gas/loongarch/relax_align.d +++ b/gas/testsuite/gas/loongarch/relax_align.d @@ -14,10 +14,10 @@ Disassembly of section .text: [ ]+4:[ ]+02c00084[ ]+addi\.d[ ]+\$a0,[ ]+\$a0,[ ]+0 [ ]+4:[ ]+R_LARCH_PCALA_LO12[ ]+L1 [ ]+4:[ ]+R_LARCH_RELAX[ ]+\*ABS\* -[ ]+8:[ ]+03400000[ ]+andi[ ]+\$zero,[ ]+\$zero,[ ]+0x0 +[ ]+8:[ ]+03400000[ ]+nop[ ]+ [ ]+8:[ ]+R_LARCH_ALIGN[ ]+\*ABS\*\+0xc -[ ]+c:[ ]+03400000[ ]+andi[ ]+\$zero,[ ]+\$zero,[ ]+0x0 -[ ]+10:[ ]+03400000[ ]+andi[ ]+\$zero,[ ]+\$zero,[ ]+0x0 +[ ]+c:[ ]+03400000[ ]+nop[ ]+ +[ ]+10:[ ]+03400000[ ]+nop[ ]+ [ ]+14:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+14:[ ]+R_LARCH_PCALA_HI20[ ]+L1 [ ]+14:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/gas/testsuite/gas/loongarch/reloc.d b/gas/testsuite/gas/loongarch/reloc.d index 6f5f110b1af..c3820c55f98 100644 --- a/gas/testsuite/gas/loongarch/reloc.d +++ b/gas/testsuite/gas/loongarch/reloc.d @@ -8,7 +8,7 @@ Disassembly of section .text: 00000000.* <.text>: -[ ]+0:[ ]+03400000[ ]+andi[ ]+\$zero,[ ]+\$zero,[ ]+0x0 +[ ]+0:[ ]+03400000[ ]+nop[ ]+ [ ]+4:[ ]+58000085[ ]+beq[ ]+\$a0,[ ]+\$a1,[ ]+0[ ]+#[ ]+0x4 [ ]+4:[ ]+R_LARCH_B16[ ]+.L1 [ ]+8:[ ]+5c000085[ ]+bne[ ]+\$a0,[ ]+\$a1,[ ]+0[ ]+#[ ]+0x8 diff --git a/include/opcode/loongarch.h b/include/opcode/loongarch.h index aa2f3fb645d..60812fb4b1f 100644 --- a/include/opcode/loongarch.h +++ b/include/opcode/loongarch.h @@ -120,6 +120,8 @@ dec2 : [1-9][0-9]? const unsigned long pinfo; #define USELESS 0x0l +/* Instruction is a simple alias only for disassembler use. */ +#define INSN_DIS_ALIAS 0x00000001l }; struct hash_control; diff --git a/ld/testsuite/ld-loongarch-elf/jmp_op.d b/ld/testsuite/ld-loongarch-elf/jmp_op.d index 09f89100195..be8290711a5 100644 --- a/ld/testsuite/ld-loongarch-elf/jmp_op.d +++ b/ld/testsuite/ld-loongarch-elf/jmp_op.d @@ -1,5 +1,5 @@ #as: -#objdump: -dr +#objdump: -dr -M no-aliases .*:[ ]+file format .* diff --git a/ld/testsuite/ld-loongarch-elf/macro_op.d b/ld/testsuite/ld-loongarch-elf/macro_op.d index 2649f63e566..c7f332e7c9d 100644 --- a/ld/testsuite/ld-loongarch-elf/macro_op.d +++ b/ld/testsuite/ld-loongarch-elf/macro_op.d @@ -8,9 +8,9 @@ Disassembly of section .text: 00000000.* <.L1>: [ ]+0:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+4:[ ]+02bffc04[ ]+addi.w[ ]+\$a0,[ ]+\$zero,[ ]+-1\(0xfff\) +[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) [ ]+8:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+c:[ ]+02bffc04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64_PC_LO20[ ]+TLS1 @@ -175,7 +175,7 @@ Disassembly of section .text: [ ]+11c:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+120:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+120:[ ]+R_LARCH_TLS_LD_PC_HI20[ ]+TLS1 -[ ]+124:[ ]+02c00005[ ]+addi.d[ ]+\$a1,[ ]+\$zero,[ ]+0 +[ ]+124:[ ]+02c00005[ ]+li\.d[ ]+\$a1,[ ]+0 [ ]+124:[ ]+R_LARCH_GOT_PC_LO12[ ]+TLS1 [ ]+124:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+128:[ ]+16000005[ ]+lu32i.d[ ]+\$a1,[ ]+0 @@ -190,7 +190,7 @@ Disassembly of section .text: [ ]+138:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+13c:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+13c:[ ]+R_LARCH_TLS_GD_PC_HI20[ ]+TLS1 -[ ]+140:[ ]+02c00005[ ]+addi.d[ ]+\$a1,[ ]+\$zero,[ ]+0 +[ ]+140:[ ]+02c00005[ ]+li\.d[ ]+\$a1,[ ]+0 [ ]+140:[ ]+R_LARCH_GOT_PC_LO12[ ]+TLS1 [ ]+140:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+144:[ ]+16000005[ ]+lu32i.d[ ]+\$a1,[ ]+0 diff --git a/ld/testsuite/ld-loongarch-elf/macro_op_32.d b/ld/testsuite/ld-loongarch-elf/macro_op_32.d index f5a2b54dd9b..5ac15fdfea8 100644 --- a/ld/testsuite/ld-loongarch-elf/macro_op_32.d +++ b/ld/testsuite/ld-loongarch-elf/macro_op_32.d @@ -9,9 +9,9 @@ Disassembly of section .text: 00000000.* <.L1>: [ ]+0:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+4:[ ]+02bffc04[ ]+addi.w[ ]+\$a0,[ ]+\$zero,[ ]+-1\(0xfff\) +[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) [ ]+8:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+c:[ ]+02bffc04[ ]+addi.w[ ]+\$a0,[ ]+\$zero,[ ]+-1\(0xfff\) +[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) [ ]+10:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+10:[ ]+R_LARCH_GOT_PC_HI20[ ]+.L1 [ ]+10:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/ld/testsuite/ld-loongarch-elf/relax-align.dd b/ld/testsuite/ld-loongarch-elf/relax-align.dd index 3149738ff71..5fce2255dda 100644 --- a/ld/testsuite/ld-loongarch-elf/relax-align.dd +++ b/ld/testsuite/ld-loongarch-elf/relax-align.dd @@ -1,7 +1,7 @@ #... .*pcaddi.* .*pcaddi.* -.*andi.* -.*andi.* +.*nop.* +.*nop.* .*0:.*pcaddi.* #pass diff --git a/opcodes/loongarch-dis.c b/opcodes/loongarch-dis.c index 0725270ed34..3a08da14763 100644 --- a/opcodes/loongarch-dis.c +++ b/opcodes/loongarch-dis.c @@ -25,6 +25,15 @@ #include "libiberty.h" #include +static bool loongarch_dis_show_aliases = true; +static const char *const *loongarch_r_disname = NULL; +static const char *const *loongarch_f_disname = NULL; +static const char *const *loongarch_fc_disname = NULL; +static const char *const *loongarch_c_disname = NULL; +static const char *const *loongarch_cr_disname = NULL; +static const char *const *loongarch_v_disname = NULL; +static const char *const *loongarch_x_disname = NULL; + static const struct loongarch_opcode * get_loongarch_opcode_by_binfmt (insn_t insn) { @@ -41,7 +50,9 @@ get_loongarch_opcode_by_binfmt (insn_t insn) { for (it = ase->opcodes; it->mask; it++) if (!ase->opc_htab[LARCH_INSN_OPC (it->match)] - && it->macro == NULL) + && it->macro == NULL + && (!(it->pinfo & INSN_DIS_ALIAS) + || loongarch_dis_show_aliases)) ase->opc_htab[LARCH_INSN_OPC (it->match)] = it; for (i = 0; i < 16; i++) if (!ase->opc_htab[i]) @@ -59,14 +70,6 @@ get_loongarch_opcode_by_binfmt (insn_t insn) return NULL; } -static const char *const *loongarch_r_disname = NULL; -static const char *const *loongarch_f_disname = NULL; -static const char *const *loongarch_fc_disname = NULL; -static const char *const *loongarch_c_disname = NULL; -static const char *const *loongarch_cr_disname = NULL; -static const char *const *loongarch_v_disname = NULL; -static const char *const *loongarch_x_disname = NULL; - static void set_default_loongarch_dis_options (void) { @@ -89,6 +92,9 @@ set_default_loongarch_dis_options (void) static int parse_loongarch_dis_option (const char *option) { + if (strcmp (option, "no-aliases") == 0) + loongarch_dis_show_aliases = false; + if (strcmp (option, "numeric") == 0) { loongarch_r_disname = loongarch_r_normal_name; @@ -310,6 +316,8 @@ print_loongarch_disassembler_options (FILE *stream) The following LoongArch disassembler options are supported for use\n\ with the -M switch (multiple options should be separated by commas):\n")); + fprintf (stream, _("\n\ + no-aliases Use canonical instruction forms.\n")); fprintf (stream, _("\n\ numeric Print numeric register names, rather than ABI names.\n")); fprintf (stream, _("\n")); diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c index bd104465ca7..3d1d2c761a5 100644 --- a/opcodes/loongarch-opc.c +++ b/opcodes/loongarch-opc.c @@ -344,9 +344,29 @@ static struct loongarch_opcode loongarch_macro_opcodes[] = { 0, 0, 0, 0, 0, 0, 0, 0 } /* Terminate the list. */ }; +static struct loongarch_opcode loongarch_alias_opcodes[] = +{ + /* match, mask, name, format, macro, include, exclude, pinfo. */ + { 0x00150000, 0xfffffc00, "move", "r0:5,r5:5", 0, 0, 0, INSN_DIS_ALIAS }, /* or rd, rj, zero */ + { 0x02800000, 0xffc003e0, "li.w", "r0:5,s10:12", 0, 0, 0, INSN_DIS_ALIAS }, /* addi.w rd, zero, simm */ + { 0x02c00000, 0xffc003e0, "li.d", "r0:5,s10:12", 0, 0, 0, INSN_DIS_ALIAS }, /* addi.d rd, zero, simm */ + { 0x03400000, 0xffffffff, "nop", "", 0, 0, 0, INSN_DIS_ALIAS }, /* andi zero, zero, 0 */ + { 0x03800000, 0xffc003e0, "li.w", "r0:5,u10:12", 0, 0, 0, INSN_DIS_ALIAS }, /* ori rd, zero, uimm */ + /* ret must come before jr because it is more specific. */ + { 0x4c000020, 0xffffffff, "ret", "", 0, 0, 0, INSN_DIS_ALIAS }, /* jirl zero, ra, 0 */ + { 0x4c000000, 0xfffffc1f, "jr", "r5:5", 0, 0, 0, INSN_DIS_ALIAS }, /* jirl zero, rj, 0 */ + { 0x60000000, 0xfc00001f, "bltz", "r5:5,sb10:16<<2", 0, 0, 0, INSN_DIS_ALIAS }, /* blt rj, zero, offset */ + { 0x60000000, 0xfc0003e0, "bgtz", "r0:5,sb10:16<<2", 0, 0, 0, INSN_DIS_ALIAS }, /* blt zero, rd, offset */ + { 0x64000000, 0xfc00001f, "bgez", "r5:5,sb10:16<<2", 0, 0, 0, INSN_DIS_ALIAS }, /* bge rj, zero, offset */ + { 0x64000000, 0xfc0003e0, "blez", "r0:5,sb10:16<<2", 0, 0, 0, INSN_DIS_ALIAS }, /* bge zero, rd, offset */ + { 0 } /* Terminate the list. */ +}; + + static struct loongarch_opcode loongarch_fix_opcodes[] = { /* match, mask, name, format, macro, include, exclude, pinfo. */ + { 0x0, 0x0, "move", "r,r", "or %1,%2,$r0", 0, 0, 0 }, { 0x00001000, 0xfffffc00, "clo.w", "r0:5,r5:5", 0, 0, 0, 0 }, { 0x00001400, 0xfffffc00, "clz.w", "r0:5,r5:5", 0, 0, 0, 0 }, { 0x00001800, 0xfffffc00, "cto.w", "r0:5,r5:5", 0, 0, 0, 0 }, @@ -367,8 +387,6 @@ static struct loongarch_opcode loongarch_fix_opcodes[] = { 0x00005400, 0xfffffc00, "bitrev.d", "r0:5,r5:5", 0, 0, 0, 0 }, { 0x00005800, 0xfffffc00, "ext.w.h", "r0:5,r5:5", 0, 0, 0, 0 }, { 0x00005c00, 0xfffffc00, "ext.w.b", "r0:5,r5:5", 0, 0, 0, 0 }, - /* or %1,%2,$r0 */ - { 0x00150000, 0xfffffc00, "move", "r0:5,r5:5", 0, 0, 0, 0 }, { 0x00006000, 0xfffffc00, "rdtimel.w", "r0:5,r5:5", 0, 0, 0, 0 }, { 0x00006400, 0xfffffc00, "rdtimeh.w", "r0:5,r5:5", 0, 0, 0, 0 }, { 0x00006800, 0xfffffc00, "rdtime.d", "r0:5,r5:5", 0, 0, 0, 0 }, @@ -2324,6 +2342,7 @@ static struct loongarch_opcode loongarch_lasx_opcodes[] = struct loongarch_ase loongarch_ASEs[] = { { &LARCH_opts.ase_ilp32, loongarch_macro_opcodes, 0, 0, { 0 }, 0, 0 }, + { &LARCH_opts.ase_ilp32, loongarch_alias_opcodes, 0, 0, { 0 }, 0, 0 }, { &LARCH_opts.ase_ilp32, loongarch_imm_opcodes, 0, 0, { 0 }, 0, 0 }, { &LARCH_opts.ase_ilp32, loongarch_privilege_opcodes, 0, 0, { 0 }, 0, 0 }, { &LARCH_opts.ase_ilp32, loongarch_load_store_opcodes, 0, 0, { 0 }, 0, 0 }, From patchwork Thu Jun 29 16:34:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WANG Xuerui X-Patchwork-Id: 114359 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9765364vqr; Thu, 29 Jun 2023 09:37:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4l3seF4VkU7VcW+Gh9U8vu+x9s1OPBul+D4qCBCtaP3ok2KTL8RO0VTwY2sj0jB2dho7w X-Received: by 2002:a05:6512:10c9:b0:4fb:89cd:9616 with SMTP id k9-20020a05651210c900b004fb89cd9616mr443290lfg.0.1688056620717; Thu, 29 Jun 2023 09:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688056620; cv=none; d=google.com; s=arc-20160816; b=EQ8hBb0mcGdC4grRiiqsYzZFL4xdxY+XxjEcR8KTJ5x68DA4Wlz1cTPf4P3RaM4bRg KOMvyDGLJgz03UA75HFXpiRTAR8u5Avi2lSUXHIMhMz1E3LU4VWy17sTIjz1lEkU6i0X Dtrk2FpQpHbn6O7aqk0hLyPqPOTQrZn/ofaDUNSc1jo9k3hMkC9aYmcoLVFwNf1mWQ5y R9G6ZsjxkpnUxkbqWVgTrQZcrTZeiW3N5TFpooGcI/VHfRoMzprYNOBsr9t1mW8TepMo 8gjRPX8o/SLt48iN9gkLdxGdQL74CQOYRdWeEAoqQ1qf4l8jw2ajCOWNARoHQ/tH8CUW MjKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=tOTpC3HLqALOKpvDcn+TGQon6mlOWeSyZPBUhwrzUTM=; fh=F52lMKP/ag7PTpjpGsg79bnedhkoffS1BBUct4g/1x0=; b=subqQv/32R6JUmqvRTgm2Ybqdg7UOqeV/R6shIRuL65Fh0m955HdwLc9HZeduSyHKT BGmNpomYDSXP0Ua6ijJ/mYUOtovWERoaHwMmLk3zSEHcAPPuzwddBmYyYQEP3Zw+C6gc AEMYJEMEXVMytMPybLGLU6KIpk39JVDBuiGV4s7fGUpMADK8hyruUCjxfct/gnvNnpuC nV/uf/UQADUvfdTVBccSDltCnUsBU8dAKSSP1a5t02eYThjrb4Cht5Cy/Z+ymk532QbF kzLGEAVcDpdt8Wl9yyOoK1QsIuNdRjUvjDkVrGkeLPssIVy15bWOYOc0sCtUNiI99pyi iWjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=vB1yrkQl; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id l4-20020a056402124400b0051bec407311si3020998edw.176.2023.06.29.09.37.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 09:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=vB1yrkQl; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87317385E00A for ; Thu, 29 Jun 2023 16:36:07 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by sourceware.org (Postfix) with ESMTPS id 2B2F43858D35 for ; Thu, 29 Jun 2023 16:35:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2B2F43858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=xen0n.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xen0n.name DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1688056512; bh=qJpCGO0cga75uzCh+6z51YQj3R4awV0QbwED+ZzPc1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vB1yrkQl3yH5APVv4ULGrk1KDG9iGnDrfb5/0NbcDDMbdWJwqODALC0M4nJU3pTZg 2Zv+AgD7FEevVRDbNx+j1aNcG7oei1IATId2wwBAvzTvmOeNJlqqju/lDAUWFhNBZG sxUHLcXiQ71T9NfSTZYbZ9JtSjY+HygHpvuD6wu0= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 40950605E0; Fri, 30 Jun 2023 00:35:12 +0800 (CST) From: WANG Xuerui To: binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , Lulu Cheng , Fangrui Song , Xi Ruoyao , WANG Xuerui Subject: [PATCH v7 2/7] opcodes/loongarch: remove unused code Date: Fri, 30 Jun 2023 00:34:59 +0800 Message-Id: <20230629163504.1331025-3-i.swmail@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230629163504.1331025-1-i.swmail@xen0n.name> References: <20230629163504.1331025-1-i.swmail@xen0n.name> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770055659196115874?= X-GMAIL-MSGID: =?utf-8?q?1770055659196115874?= From: WANG Xuerui Remove some unused declarations and code. include/ChangeLog: * opcode/loongarch.h: Remove unused declarations. opcodes/ChangeLog: * loongarch-dis.c (loongarch_parse_dis_options): Remove. (my_print_address_func): Likewise. (loongarch_disassemble_one): Likewise. Signed-off-by: WANG Xuerui --- include/opcode/loongarch.h | 5 ----- opcodes/loongarch-dis.c | 35 ----------------------------------- 2 files changed, 40 deletions(-) diff --git a/include/opcode/loongarch.h b/include/opcode/loongarch.h index 60812fb4b1f..e9632ad3361 100644 --- a/include/opcode/loongarch.h +++ b/include/opcode/loongarch.h @@ -176,11 +176,6 @@ dec2 : [1-9][0-9]? extern void loongarch_eliminate_adjacent_repeat_char (char *dest, char c); - extern int loongarch_parse_dis_options (const char *opts_in); - extern void loongarch_disassemble_one ( - int64_t pc, insn_t insn, - int (*fprintf_func) (void *stream, const char *format, ...), void *stream); - extern const char *const loongarch_r_normal_name[32]; extern const char *const loongarch_r_lp64_name[32]; extern const char *const loongarch_r_lp64_name1[32]; diff --git a/opcodes/loongarch-dis.c b/opcodes/loongarch-dis.c index 3a08da14763..116b6667128 100644 --- a/opcodes/loongarch-dis.c +++ b/opcodes/loongarch-dis.c @@ -322,38 +322,3 @@ with the -M switch (multiple options should be separated by commas):\n")); numeric Print numeric register names, rather than ABI names.\n")); fprintf (stream, _("\n")); } - -int -loongarch_parse_dis_options (const char *opts_in) -{ - return parse_loongarch_dis_options (opts_in); -} - -static void -my_print_address_func (bfd_vma addr, struct disassemble_info *dinfo) -{ - dinfo->fprintf_func (dinfo->stream, "0x%llx", (long long) addr); -} - -void -loongarch_disassemble_one (int64_t pc, insn_t insn, - int (*fprintf_func) (void *stream, - const char *format, ...), - void *stream) -{ - static struct disassemble_info my_disinfo = - { - .print_address_func = my_print_address_func, - }; - static int not_init_yet = 1; - if (not_init_yet) - { - loongarch_parse_dis_options (NULL); - not_init_yet = 0; - } - - my_disinfo.fprintf_func = fprintf_func; - my_disinfo.stream = stream; - my_disinfo.target = pc; - disassemble_one (insn, &my_disinfo); -} From patchwork Thu Jun 29 16:35:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WANG Xuerui X-Patchwork-Id: 114356 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9764608vqr; Thu, 29 Jun 2023 09:35:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlEeJrWGGA+z5cMlYb8M6iOGfJ034xv7psJZxitAX9e9KpT3oN6s4Lt4xrWi8HxauUi6D+ym X-Received: by 2002:a2e:9f14:0:b0:2b4:6f0c:4765 with SMTP id u20-20020a2e9f14000000b002b46f0c4765mr176942ljk.16.1688056544427; Thu, 29 Jun 2023 09:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688056544; cv=none; d=google.com; s=arc-20160816; b=FwkDp10LeErYNi8z2fNfoWKlYuFCSkWUBAq1oXVcIprHvNuHJjJVvNnJTcw7PMFvO2 l8M4daOppP/K7ZBFyxSKJdpCfzp4ACOVZ1vOe8p/Ce/8EvuaAk5wUx8xZIIeE3geDwkU XvjRGw1Y+CvWs/PPJHeQghbiGNkyY0w3yyIy0hodUEYTIlVNXBpq8uQwe1Dag0RtpC0u +adAXNGHsSmbOXu57C3pSZKR+cnNuCldHauSHdafF9p+8c2xseUWhDfWiaYUBfxqTdDd LE7pO8s16gSXkQebCkoaAQ5ZHgnqhnpzPAdlcdbRhQt0HZT04DxBrGw4jLz5FuVBABG7 CbzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=zSHPYeNq4LBBVmKhfj7oKwHxZL1sM6GjZZFFU6Uodtg=; fh=F52lMKP/ag7PTpjpGsg79bnedhkoffS1BBUct4g/1x0=; b=NmDWM4Lb2jW8Pj4HP7PdQAX7SAoVOW+QVO81UUCn6/BAui1y3HM3bA1sqMylUqlrSJ nI85RYOCftKiHo537TsSTwf1ImLP29dkLrN9hBRvLRJnaOkp4FwsqS7G4Xnx+5ZoBoRD QVhsNSzOk0fD9mPP0x1b4HV7yVHBK0xKD3KY13OHciMoCUNIibOCwuNwT71AwUN49KTg npyUyKj/gQniPaeNrOQqRggK4M98ZxGsJf+CYpXPKItVmd8vn/5sCT6vGYuj7fX3+3Cz NCxWEs8qO1gV5t+u+JFo6pAcEocyEiY3uGJW6070QJRIMzke3Y5gJVNrtvA0SiuTxB2b nsbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=Wxz7jwbW; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id lh22-20020a170906f8d600b0098897c46e08si6938176ejb.987.2023.06.29.09.35.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 09:35:44 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=Wxz7jwbW; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4CEC73858C60 for ; Thu, 29 Jun 2023 16:35:41 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by sourceware.org (Postfix) with ESMTPS id E08303858CD1 for ; Thu, 29 Jun 2023 16:35:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E08303858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=xen0n.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xen0n.name DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1688056514; bh=WranubCmJKlCeYWGbXDJU5DQmIs3zv0u/DBfPq8q6Ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wxz7jwbWYUPnKzDFi9ZBSr0FnecWS3tK5oD8Q7s7B3XUR44UgnKyzRGnk+BJ/Jz3/ ds2fMiJ7asOLWnHxDOCaFNnKtm62RNCiMqOJrpmKNMaXGB/YckjWGr7sbfLjjqnccY wpCb/lacK1xTxJN8ZMw6oQWQvso9ajfzXFKxBfkg= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 4113A605E5; Fri, 30 Jun 2023 00:35:14 +0800 (CST) From: WANG Xuerui To: binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , Lulu Cheng , Fangrui Song , Xi Ruoyao , WANG Xuerui Subject: [PATCH v7 3/7] opcodes/loongarch: implement style support in the disassembler Date: Fri, 30 Jun 2023 00:35:00 +0800 Message-Id: <20230629163504.1331025-4-i.swmail@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230629163504.1331025-1-i.swmail@xen0n.name> References: <20230629163504.1331025-1-i.swmail@xen0n.name> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770055579074500564?= X-GMAIL-MSGID: =?utf-8?q?1770055579074500564?= From: WANG Xuerui Update the LoongArch disassembler to supply style information to the disassembler output. The output formatting remains unchanged. opcodes/ChangeLog: * disassemble.c: Mark LoongArch as created_styled_output=true. * loongarch-dis.c (dis_one_arg): Use fprintf_styled_func throughout with proper styles. Signed-off-by: WANG Xuerui --- opcodes/disassemble.c | 5 +++++ opcodes/loongarch-dis.c | 45 ++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c index 03cfccc562e..7a4a641c2b9 100644 --- a/opcodes/disassemble.c +++ b/opcodes/disassemble.c @@ -647,6 +647,11 @@ disassemble_init_for_target (struct disassemble_info * info) info->skip_zeroes = 16; break; #endif +#ifdef ARCH_loongarch + case bfd_arch_loongarch: + info->created_styled_output = true; + break; +#endif #ifdef ARCH_tic4x case bfd_arch_tic4x: info->skip_zeroes = 32; diff --git a/opcodes/loongarch-dis.c b/opcodes/loongarch-dis.c index 116b6667128..8d44dcebb4c 100644 --- a/opcodes/loongarch-dis.c +++ b/opcodes/loongarch-dis.c @@ -138,7 +138,7 @@ dis_one_arg (char esc1, char esc2, const char *bit_field, if (esc1) { if (need_comma) - info->fprintf_func (info->stream, ", "); + info->fprintf_styled_func (info->stream, dis_style_text, ", "); need_comma = 1; imm = loongarch_decode_imm (bit_field, insn, 1); u_imm = loongarch_decode_imm (bit_field, insn, 0); @@ -147,42 +147,45 @@ dis_one_arg (char esc1, char esc2, const char *bit_field, switch (esc1) { case 'r': - info->fprintf_func (info->stream, "%s", loongarch_r_disname[u_imm]); + info->fprintf_styled_func (info->stream, dis_style_register, "%s", loongarch_r_disname[u_imm]); break; case 'f': switch (esc2) { case 'c': - info->fprintf_func (info->stream, "%s", loongarch_fc_disname[u_imm]); + info->fprintf_styled_func (info->stream, dis_style_register, "%s", loongarch_fc_disname[u_imm]); break; default: - info->fprintf_func (info->stream, "%s", loongarch_f_disname[u_imm]); + info->fprintf_styled_func (info->stream, dis_style_register, "%s", loongarch_f_disname[u_imm]); } break; case 'c': switch (esc2) { case 'r': - info->fprintf_func (info->stream, "%s", loongarch_cr_disname[u_imm]); + info->fprintf_styled_func (info->stream, dis_style_register, "%s", loongarch_cr_disname[u_imm]); break; default: - info->fprintf_func (info->stream, "%s", loongarch_c_disname[u_imm]); + info->fprintf_styled_func (info->stream, dis_style_register, "%s", loongarch_c_disname[u_imm]); } break; case 'v': - info->fprintf_func (info->stream, "%s", loongarch_v_disname[u_imm]); + info->fprintf_styled_func (info->stream, dis_style_register, "%s", loongarch_v_disname[u_imm]); break; case 'x': - info->fprintf_func (info->stream, "%s", loongarch_x_disname[u_imm]); + info->fprintf_styled_func (info->stream, dis_style_register, "%s", loongarch_x_disname[u_imm]); break; case 'u': - info->fprintf_func (info->stream, "0x%x", u_imm); + info->fprintf_styled_func (info->stream, dis_style_immediate, "0x%x", u_imm); break; case 's': if (imm == 0) - info->fprintf_func (info->stream, "%d", imm); + info->fprintf_styled_func (info->stream, dis_style_immediate, "%d", imm); else - info->fprintf_func (info->stream, "%d(0x%x)", imm, u_imm); + { + info->fprintf_styled_func (info->stream, dis_style_immediate, "%d", imm); + info->fprintf_styled_func (info->stream, dis_style_text, "(0x%x)", u_imm); + } switch (esc2) { case 'b': @@ -236,44 +239,40 @@ disassemble_one (insn_t insn, struct disassemble_info *info) for (i = 31; 0 <= i; i--) { if (t & insn) - info->fprintf_func (info->stream, "1"); + info->fprintf_styled_func (info->stream, dis_style_text, "1"); else - info->fprintf_func (info->stream, "0"); + info->fprintf_styled_func (info->stream, dis_style_text, "0"); if (have_space[i]) - info->fprintf_func (info->stream, " "); + info->fprintf_styled_func (info->stream, dis_style_text, " "); t = t >> 1; } - info->fprintf_func (info->stream, "\t"); + info->fprintf_styled_func (info->stream, dis_style_text, "\t"); #endif if (!opc) { info->insn_type = dis_noninsn; - info->fprintf_func (info->stream, "0x%08x", insn); + info->fprintf_styled_func (info->stream, dis_style_immediate, "0x%08x", insn); return; } info->insn_type = dis_nonbranch; - info->fprintf_func (info->stream, "%-12s", opc->name); + info->fprintf_styled_func (info->stream, dis_style_mnemonic, "%-12s", opc->name); { char *fake_args = xmalloc (strlen (opc->format) + 1); const char *fake_arg_strs[MAX_ARG_NUM_PLUS_2]; strcpy (fake_args, opc->format); if (0 < loongarch_split_args_by_comma (fake_args, fake_arg_strs)) - info->fprintf_func (info->stream, "\t"); + info->fprintf_styled_func (info->stream, dis_style_text, "\t"); info->private_data = &insn; loongarch_foreach_args (opc->format, fake_arg_strs, dis_one_arg, info); free (fake_args); } - if (info->insn_type == dis_branch || info->insn_type == dis_condbranch - /* Someother if we have extra info to print. */) - info->fprintf_func (info->stream, "\t#"); - if (info->insn_type == dis_branch || info->insn_type == dis_condbranch) { - info->fprintf_func (info->stream, " "); + info->fprintf_styled_func (info->stream, dis_style_comment_start, "\t# "); info->print_address_func (info->target, info); } } From patchwork Thu Jun 29 16:35:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WANG Xuerui X-Patchwork-Id: 114363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9766615vqr; Thu, 29 Jun 2023 09:39:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFP/qqG06Hg/jdJfEQCCeAr/jiIQhe8IFH6wzAJ4EomYP6tDJA0KvSr13ZBxnhWN3RnG03R X-Received: by 2002:a05:651c:1022:b0:2b6:c19a:1007 with SMTP id w2-20020a05651c102200b002b6c19a1007mr178364ljm.53.1688056747238; Thu, 29 Jun 2023 09:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688056747; cv=none; d=google.com; s=arc-20160816; b=xA0MSyHHAzaBesCmho3iM/X13pswYmFUq2yRrL4gzv9gb5v6BF/mHt3OnEfecNk8Bm rinNuJrjoqXgaZqQlGpYlGcOjwBtxxiuo8iiAHvK/Ptkt75jcG6tBXet+qUaO+irzsKq Usjv2HY4cQpu7es309EDyVENuhZ4qTLMl7BYVpNKiZaKStQleWoGlsTH9ZtFrfXmWDrH vEqFmxgQKLbs14s4c9QqKOxRzh2tYutEbzLJIL34ztJTOqCqeydYiB5RVtx//D6EesXr caajk3RuZ9z2PQpBMb1JI6AN0hTdIrPOQvyau6fRyPyD7yK1X1mocV+lL6+kdwFDaS3U lGyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=eTMmA9RPADZ5s1eg1VKWKQ5q0FyRvWOQFcAi+W+OVCw=; fh=F52lMKP/ag7PTpjpGsg79bnedhkoffS1BBUct4g/1x0=; b=EinAia+IfY3kdXXiWarUe1QOmuDb9opItCpPeqwIWluXEcN8TqlsPvJsnuzBHKmxI2 K3wAwNFCfH2rm13dP11d3n73zetzYl/GKWthJwOmR+WZnCbhXg68P1s3x3pBESRP8XAZ ZY6HTf3jNeGlkK7B/YXxH79+U+rNIdMIacPXEOuEG1gg4XuqyrunKXMUik41UFwhSv6N xAt8cfSkVeiujH5/sqdCKiYnTxOxgSYezek+EjLBfxrJJhgmucIyz5qRHZeBWVqQYvQm tQcZApzHQU+Ccmfg326te2aoycVKlK6/n8Mi7BYuGG+tVjcpsINuM6jcWQaPfJ06FoGb 6FBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b="Z/IapCig"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q2-20020aa7da82000000b0051a2dfc8c43si6388498eds.547.2023.06.29.09.39.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 09:39:07 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b="Z/IapCig"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B08C03882021 for ; Thu, 29 Jun 2023 16:36:42 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by sourceware.org (Postfix) with ESMTPS id A28BF385840A for ; Thu, 29 Jun 2023 16:35:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A28BF385840A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=xen0n.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xen0n.name DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1688056516; bh=gDyZrih98DVCW8bpYnTgLJ++2qVdCEKsvsKg28L8zVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z/IapCigeCuDGbAGRUSug7CFQ1q+koGnZWP7DShpO9rkJ+uV3eGfCWVxDrKJUamjr cg1wCOj4bbY3VKk3mnxbohIgY6ZuPeiZjhdP5QRHhTQimwgmpEI1yRPYDdXa9AdywS CsyOysB+YhOTITr9RnVEjrAmllGmtP7oTvqgRpmc= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 01D0060103; Fri, 30 Jun 2023 00:35:15 +0800 (CST) From: WANG Xuerui To: binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , Lulu Cheng , Fangrui Song , Xi Ruoyao , WANG Xuerui Subject: [PATCH v7 4/7] opcodes/loongarch: style disassembled address offsets as such Date: Fri, 30 Jun 2023 00:35:01 +0800 Message-Id: <20230629163504.1331025-5-i.swmail@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230629163504.1331025-1-i.swmail@xen0n.name> References: <20230629163504.1331025-1-i.swmail@xen0n.name> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770055791992024377?= X-GMAIL-MSGID: =?utf-8?q?1770055791992024377?= From: WANG Xuerui Add a modifier char 'o' telling the disassembler to print the immediate using the address offset style, and mark the memory access instructions' offset operands as such. opcodes/ChangeLog: * loongarch-dis.c (dis_one_arg): Style disassembled address offsets as such when the operand has a modifier char 'o'. * loongarch-opc.c: Add 'o' to operands that represent address offsets. Signed-off-by: WANG Xuerui --- opcodes/loongarch-dis.c | 19 +++++++++++++--- opcodes/loongarch-opc.c | 50 ++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/opcodes/loongarch-dis.c b/opcodes/loongarch-dis.c index 8d44dcebb4c..11e410f176a 100644 --- a/opcodes/loongarch-dis.c +++ b/opcodes/loongarch-dis.c @@ -134,6 +134,7 @@ dis_one_arg (char esc1, char esc2, const char *bit_field, struct disassemble_info *info = context; insn_t insn = *(insn_t *) info->private_data; int32_t imm, u_imm; + enum disassembler_style style; if (esc1) { @@ -176,14 +177,26 @@ dis_one_arg (char esc1, char esc2, const char *bit_field, info->fprintf_styled_func (info->stream, dis_style_register, "%s", loongarch_x_disname[u_imm]); break; case 'u': - info->fprintf_styled_func (info->stream, dis_style_immediate, "0x%x", u_imm); + style = esc2 == 'o' ? dis_style_address_offset : dis_style_immediate; + info->fprintf_styled_func (info->stream, style, "0x%x", u_imm); break; case 's': + switch (esc2) + { + case 'b': + case 'o': + /* Both represent address offsets. */ + style = dis_style_address_offset; + break; + default: + style = dis_style_immediate; + break; + } if (imm == 0) - info->fprintf_styled_func (info->stream, dis_style_immediate, "%d", imm); + info->fprintf_styled_func (info->stream, style, "%d", imm); else { - info->fprintf_styled_func (info->stream, dis_style_immediate, "%d", imm); + info->fprintf_styled_func (info->stream, style, "%d", imm); info->fprintf_styled_func (info->stream, dis_style_text, "(0x%x)", u_imm); } switch (esc2) diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c index 3d1d2c761a5..8be227cd9a9 100644 --- a/opcodes/loongarch-opc.c +++ b/opcodes/loongarch-opc.c @@ -784,26 +784,26 @@ static struct loongarch_opcode loongarch_4opt_double_float_opcodes[] = static struct loongarch_opcode loongarch_load_store_opcodes[] = { /* match, mask, name, format, macro, include, exclude, pinfo. */ - { 0x20000000, 0xff000000, "ll.w", "r0:5,r5:5,s10:14<<2", 0, 0, 0, 0 }, - { 0x21000000, 0xff000000, "sc.w", "r0:5,r5:5,s10:14<<2", 0, 0, 0, 0 }, - { 0x22000000, 0xff000000, "ll.d", "r0:5,r5:5,s10:14<<2", 0, 0, 0, 0 }, - { 0x23000000, 0xff000000, "sc.d", "r0:5,r5:5,s10:14<<2", 0, 0, 0, 0 }, - { 0x24000000, 0xff000000, "ldptr.w", "r0:5,r5:5,s10:14<<2", 0, 0, 0, 0 }, - { 0x25000000, 0xff000000, "stptr.w", "r0:5,r5:5,s10:14<<2", 0, 0, 0, 0 }, - { 0x26000000, 0xff000000, "ldptr.d", "r0:5,r5:5,s10:14<<2", 0, 0, 0, 0 }, - { 0x27000000, 0xff000000, "stptr.d", "r0:5,r5:5,s10:14<<2", 0, 0, 0, 0 }, - { 0x28000000, 0xffc00000, "ld.b", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x28400000, 0xffc00000, "ld.h", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x28800000, 0xffc00000, "ld.w", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x28c00000, 0xffc00000, "ld.d", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x29000000, 0xffc00000, "st.b", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x29400000, 0xffc00000, "st.h", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x29800000, 0xffc00000, "st.w", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x29c00000, 0xffc00000, "st.d", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x2a000000, 0xffc00000, "ld.bu", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x2a400000, 0xffc00000, "ld.hu", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x2a800000, 0xffc00000, "ld.wu", "r0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x2ac00000, 0xffc00000, "preld", "u0:5,r5:5,s10:12", 0, 0, 0, 0 }, + { 0x20000000, 0xff000000, "ll.w", "r0:5,r5:5,so10:14<<2", 0, 0, 0, 0 }, + { 0x21000000, 0xff000000, "sc.w", "r0:5,r5:5,so10:14<<2", 0, 0, 0, 0 }, + { 0x22000000, 0xff000000, "ll.d", "r0:5,r5:5,so10:14<<2", 0, 0, 0, 0 }, + { 0x23000000, 0xff000000, "sc.d", "r0:5,r5:5,so10:14<<2", 0, 0, 0, 0 }, + { 0x24000000, 0xff000000, "ldptr.w", "r0:5,r5:5,so10:14<<2", 0, 0, 0, 0 }, + { 0x25000000, 0xff000000, "stptr.w", "r0:5,r5:5,so10:14<<2", 0, 0, 0, 0 }, + { 0x26000000, 0xff000000, "ldptr.d", "r0:5,r5:5,so10:14<<2", 0, 0, 0, 0 }, + { 0x27000000, 0xff000000, "stptr.d", "r0:5,r5:5,so10:14<<2", 0, 0, 0, 0 }, + { 0x28000000, 0xffc00000, "ld.b", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x28400000, 0xffc00000, "ld.h", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x28800000, 0xffc00000, "ld.w", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x28c00000, 0xffc00000, "ld.d", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x29000000, 0xffc00000, "st.b", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x29400000, 0xffc00000, "st.h", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x29800000, 0xffc00000, "st.w", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x29c00000, 0xffc00000, "st.d", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x2a000000, 0xffc00000, "ld.bu", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x2a400000, 0xffc00000, "ld.hu", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x2a800000, 0xffc00000, "ld.wu", "r0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x2ac00000, 0xffc00000, "preld", "u0:5,r5:5,so10:12", 0, 0, 0, 0 }, { 0x38000000, 0xffff8000, "ldx.b", "r0:5,r5:5,r10:5", 0, 0, 0, 0 }, { 0x38040000, 0xffff8000, "ldx.h", "r0:5,r5:5,r10:5", 0, 0, 0, 0 }, { 0x38080000, 0xffff8000, "ldx.w", "r0:5,r5:5,r10:5", 0, 0, 0, 0 }, @@ -936,8 +936,8 @@ static struct loongarch_opcode loongarch_load_store_opcodes[] = static struct loongarch_opcode loongarch_single_float_load_store_opcodes[] = { /* match, mask, name, format, macro, include, exclude, pinfo. */ - { 0x2b000000, 0xffc00000, "fld.s", "f0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x2b400000, 0xffc00000, "fst.s", "f0:5,r5:5,s10:12", 0, 0, 0, 0 }, + { 0x2b000000, 0xffc00000, "fld.s", "f0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x2b400000, 0xffc00000, "fst.s", "f0:5,r5:5,so10:12", 0, 0, 0, 0 }, { 0x38300000, 0xffff8000, "fldx.s", "f0:5,r5:5,r10:5", 0, &LARCH_opts.ase_lp64, 0, 0 }, { 0x38380000, 0xffff8000, "fstx.s", "f0:5,r5:5,r10:5", 0, &LARCH_opts.ase_lp64, 0, 0 }, { 0x38740000, 0xffff8000, "fldgt.s", "f0:5,r5:5,r10:5", 0, &LARCH_opts.ase_lp64, 0, 0 }, @@ -950,8 +950,8 @@ static struct loongarch_opcode loongarch_single_float_load_store_opcodes[] = static struct loongarch_opcode loongarch_double_float_load_store_opcodes[] = { /* match, mask, name, format, macro, include, exclude, pinfo. */ - { 0x2b800000, 0xffc00000, "fld.d", "f0:5,r5:5,s10:12", 0, 0, 0, 0 }, - { 0x2bc00000, 0xffc00000, "fst.d", "f0:5,r5:5,s10:12", 0, 0, 0, 0 }, + { 0x2b800000, 0xffc00000, "fld.d", "f0:5,r5:5,so10:12", 0, 0, 0, 0 }, + { 0x2bc00000, 0xffc00000, "fst.d", "f0:5,r5:5,so10:12", 0, 0, 0, 0 }, { 0x38340000, 0xffff8000, "fldx.d", "f0:5,r5:5,r10:5", 0, &LARCH_opts.ase_lp64, 0, 0 }, { 0x383c0000, 0xffff8000, "fstx.d", "f0:5,r5:5,r10:5", 0, &LARCH_opts.ase_lp64, 0, 0 }, { 0x38748000, 0xffff8000, "fldgt.d", "f0:5,r5:5,r10:5", 0, &LARCH_opts.ase_lp64, 0, 0 }, @@ -977,7 +977,7 @@ static struct loongarch_opcode loongarch_jmp_opcodes[] = { 0x40000000, 0xfc000000, "beqz", "r5:5,sb0:5|10:16<<2", 0, 0, 0, 0 }, { 0x0, 0x0, "bnez", "r,la", "bnez %1,%%b21(%2)", 0, 0, 0 }, { 0x44000000, 0xfc000000, "bnez", "r5:5,sb0:5|10:16<<2", 0, 0, 0, 0 }, - { 0x4c000000, 0xfc000000, "jirl", "r0:5,r5:5,s10:16<<2", 0, 0, 0, 0 }, + { 0x4c000000, 0xfc000000, "jirl", "r0:5,r5:5,so10:16<<2", 0, 0, 0, 0 }, { 0x0, 0x0, "b", "la", "b %%b26(%1)", 0, 0, 0 }, { 0x50000000, 0xfc000000, "b", "sb0:10|10:16<<2", 0, 0, 0, 0 }, { 0x0, 0x0, "bl", "la", "bl %%b26(%1)", 0, 0, 0 }, From patchwork Thu Jun 29 16:35:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WANG Xuerui X-Patchwork-Id: 114362 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9766569vqr; Thu, 29 Jun 2023 09:39:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlEoAxrcDSNxnMGYjfKcGQZVxVdH1ifaqaKKqwUsZa32BNbSv7loOsId2DUeww8/4QeKWTUL X-Received: by 2002:a17:906:cb8e:b0:973:daa0:2f6 with SMTP id mf14-20020a170906cb8e00b00973daa002f6mr45769ejb.3.1688056743981; Thu, 29 Jun 2023 09:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688056743; cv=none; d=google.com; s=arc-20160816; b=fvpgr0Fli2EgVQHGzn28BwYtxg1IVF9io8inG+10FaMO3VFhlP4UA5iK6yTF95wRZA AlS7SS48HbxStmkUysxmOB2Z47xHBsRkn7/4/e+eXjHkCbnKmXq5D6WxsKxmiBYxu1IA 2kQ4OJQHDo2x50xT5rfBbwSEMcMrDVAonFnPYyPM2wzTPiXdTAsuAGhIHdD4AxZwsrJ9 BAX2wqXp94kdWNB1AVT93R5FqPtd61GbU7C+PlMlc8gJFguo5OJIVQvID36ZzeLqjHDL FRMglZa/BKdTWuGtVEQPZAWOIUv5IpxXpMkmC7yDLQ1erIDsBm7DPCQs7lB9H/TyF7pG hSoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=pOJVXDKHVr2/r6fHZxa7m9fhtVJ6dONZ+UBTuEMV+/U=; fh=F52lMKP/ag7PTpjpGsg79bnedhkoffS1BBUct4g/1x0=; b=g1JWFAvSmP4184MeBqpUAGhcETfx7DVCb9n7OfbFZcxix9aob4549QD5RB4m4uRE9P w4gd/fIgEdCWVkXNv2mjR6sbT8n0c8LxDokkGV0iI+4jzUBgIWkKqSq0+njgTxSsQe0W m/lfzj6NUeFpbkxoLDJOT+nNQpWRxaMc/dMynqgBCBQtyYebVkR00f/h1vP4nuSxb4fa e8Je0+G8WlxVpKwRd4QoRcZ+UViKmgCUQzPBQUBqDEceqYf9ev5VgYKBxD7Wu6o1slZQ tiZmq7PWgdYFo1O97m+5+ivJKXJrJjwO8/khitJ86PkM2DNtqj30W/Yq41gW7EyjRuC2 tIYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=DviOgg8K; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id bm6-20020a170906c04600b00982b5e0e8d1si7091749ejb.374.2023.06.29.09.39.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 09:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=DviOgg8K; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A9343856251 for ; Thu, 29 Jun 2023 16:36:41 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by sourceware.org (Postfix) with ESMTPS id 6597B385841E for ; Thu, 29 Jun 2023 16:35:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6597B385841E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=xen0n.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xen0n.name DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1688056518; bh=KB5ZJkSI70V8iq7i3mf59dBHozZEMdpcXKNW2dE8HMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DviOgg8KWp5KShz7S2Kl9I2mThjCVidaP8vm4RuS0MTMGI4WaOrsdRUgPPn/1SPBF yJ6fcRTb+LdJXivqVuWt06QRU0WtPgqDekG9tbdcdFJDIsKwiif1qkSKO4+RMFildp f+cX/82Pp+hfgKXuRBVGpcPe+ecZOoqpSVp5g8l0= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 8F8B6605E0; Fri, 30 Jun 2023 00:35:18 +0800 (CST) From: WANG Xuerui To: binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , Lulu Cheng , Fangrui Song , Xi Ruoyao , WANG Xuerui Subject: [PATCH v7 5/7] opcodes/loongarch: do not print hex notation for signed immediates Date: Fri, 30 Jun 2023 00:35:02 +0800 Message-Id: <20230629163504.1331025-6-i.swmail@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230629163504.1331025-1-i.swmail@xen0n.name> References: <20230629163504.1331025-1-i.swmail@xen0n.name> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770055788541223882?= X-GMAIL-MSGID: =?utf-8?q?1770055788541223882?= From: WANG Xuerui The additional hex notation was minimally useful when one had to inspect code with heavy bit manipulation, or of unclear signedness, but it clutters the output, and the style is not regular assembly language syntax either. Precisely how one approaches the original use case is not taken care of in this patch (maybe we want a disassembler option forcing a certain style for immediates, like for example printing every immediate in decimal or hexadecimal notation), but at least let's stop the current practice. ChangeLog: * testsuite/gas/loongarch/imm_ins.d: Update test case. * testsuite/gas/loongarch/imm_ins_32.d: Likewise. * testsuite/gas/loongarch/imm_op.d: Likewise. * testsuite/gas/loongarch/jmp_op.d: Likewise. * testsuite/gas/loongarch/load_store_op.d: Likewise. * testsuite/gas/loongarch/macro_op.d: Likewise. * testsuite/gas/loongarch/macro_op_32.d: Likewise. * testsuite/gas/loongarch/privilege_op.d: Likewise. * testsuite/gas/loongarch/uleb128.d: Likewise. * testsuite/gas/loongarch/vector.d: Likewise. ld/ChangeLog: * testsuite/ld-loongarch-elf/jmp_op.d: Update test case. * testsuite/ld-loongarch-elf/macro_op.d: Likewise. * testsuite/ld-loongarch-elf/macro_op_32.d: Likewise. opcodes/ChangeLog: * loongarch-dis.c (dis_one_arg): Remove the "(0x%x)" part from disassembly output of signed immediate operands. Signed-off-by: WANG Xuerui --- gas/testsuite/gas/loongarch/imm_ins.d | 82 ++++++------ gas/testsuite/gas/loongarch/imm_ins_32.d | 52 ++++---- gas/testsuite/gas/loongarch/imm_op.d | 44 +++--- gas/testsuite/gas/loongarch/jmp_op.d | 38 +++--- gas/testsuite/gas/loongarch/load_store_op.d | 80 +++++------ gas/testsuite/gas/loongarch/macro_op.d | 4 +- gas/testsuite/gas/loongarch/macro_op_32.d | 4 +- gas/testsuite/gas/loongarch/privilege_op.d | 8 +- gas/testsuite/gas/loongarch/uleb128.d | 2 +- gas/testsuite/gas/loongarch/vector.d | 140 ++++++++++---------- ld/testsuite/ld-loongarch-elf/jmp_op.d | 38 +++--- ld/testsuite/ld-loongarch-elf/macro_op.d | 4 +- ld/testsuite/ld-loongarch-elf/macro_op_32.d | 4 +- opcodes/loongarch-dis.c | 8 +- 14 files changed, 251 insertions(+), 257 deletions(-) diff --git a/gas/testsuite/gas/loongarch/imm_ins.d b/gas/testsuite/gas/loongarch/imm_ins.d index c588b5e0e25..f00110cd8a3 100644 --- a/gas/testsuite/gas/loongarch/imm_ins.d +++ b/gas/testsuite/gas/loongarch/imm_ins.d @@ -9,10 +9,10 @@ Disassembly of section .text: 00000000.* <.text>: [ ]+0:[ ]+03848c0c[ ]+li.w[ ]+\$t0,[ ]+0x123 -[ ]+4:[ ]+15ffe00d[ ]+lu12i.w[ ]+\$t1,[ ]+-256\(0xfff00\) -[ ]+8:[ ]+16001fed[ ]+lu32i.d[ ]+\$t1,[ ]+255\(0xff\) -[ ]+c:[ ]+02bffc0e[ ]+li.w[ ]+\$t2,[ ]+-1\(0xfff\) -[ ]+10:[ ]+1601ffee[ ]+lu32i.d[ ]+\$t2,[ ]+4095\(0xfff\) +[ ]+4:[ ]+15ffe00d[ ]+lu12i.w[ ]+\$t1,[ ]+-256 +[ ]+8:[ ]+16001fed[ ]+lu32i.d[ ]+\$t1,[ ]+255 +[ ]+c:[ ]+02bffc0e[ ]+li.w[ ]+\$t2,[ ]+-1 +[ ]+10:[ ]+1601ffee[ ]+lu32i.d[ ]+\$t2,[ ]+4095 [ ]+14:[ ]+0004b58b[ ]+alsl.w[ ]+\$a7,[ ]+\$t0,[ ]+\$t1,[ ]+0x2 [ ]+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loongarch/imm_ins_32.d +++ b/gas/testsuite/gas/loongarch/imm_ins_32.d @@ -19,39 +19,39 @@ Disassembly of section .text: [ ]+20:[ ]+0044898b[ ]+srli.w[ ]+\$a7,[ ]+\$t0,[ ]+0x2 [ ]+24:[ ]+004889ac[ ]+srai.w[ ]+\$t0,[ ]+\$t1,[ ]+0x2 [ ]+28:[ ]+006209ac[ ]+bstrins.w[ ]+\$t0,[ ]+\$t1,[ ]+0x2,[ ]+0x2 -[ ]+2c:[ ]+02048dac[ ]+slti[ ]+\$t0,[ ]+\$t1,[ ]+291\(0x123\) -[ ]+30:[ ]+02448dac[ ]+sltui[ ]+\$t0,[ ]+\$t1,[ ]+291\(0x123\) -[ ]+34:[ ]+02848dac[ ]+addi.w[ ]+\$t0,[ ]+\$t1,[ ]+291\(0x123\) +[ ]+2c:[ ]+02048dac[ ]+slti[ ]+\$t0,[ ]+\$t1,[ ]+291 +[ ]+30:[ ]+02448dac[ ]+sltui[ ]+\$t0,[ ]+\$t1,[ ]+291 +[ ]+34:[ ]+02848dac[ ]+addi.w[ ]+\$t0,[ ]+\$t1,[ ]+291 [ ]+38:[ ]+034009ac[ ]+andi[ ]+\$t0,[ ]+\$t1,[ ]+0x2 [ ]+3c:[ ]+038009ac[ ]+ori[ ]+\$t0,[ ]+\$t1,[ ]+0x2 [ ]+40:[ ]+03c009ac[ ]+xori[ ]+\$t0,[ ]+\$t1,[ ]+0x2 -[ ]+44:[ ]+1400246c[ ]+lu12i.w[ ]+\$t0,[ ]+291\(0x123\) -[ ]+48:[ ]+1800246c[ ]+pcaddi[ ]+\$t0,[ ]+291\(0x123\) -[ ]+4c:[ ]+1a00246c[ ]+pcalau12i[ ]+\$t0,[ ]+291\(0x123\) -[ ]+50:[ ]+1c00246c[ ]+pcaddu12i[ ]+\$t0,[ ]+291\(0x123\) -[ ]+54:[ ]+1e00246c[ ]+pcaddu18i[ ]+\$t0,[ ]+291\(0x123\) +[ ]+44:[ ]+1400246c[ ]+lu12i.w[ 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[ ]+298401ac[ ]+st.w[ ]+\$t0,[ ]+\$t1,[ ]+256 +[ ]+a0:[ ]+2a0401ac[ ]+ld.bu[ ]+\$t0,[ ]+\$t1,[ ]+256 +[ ]+a4:[ ]+2a4401ac[ ]+ld.hu[ ]+\$t0,[ ]+\$t1,[ ]+256 +[ ]+a8:[ ]+2a8401ac[ ]+ld.wu[ ]+\$t0,[ ]+\$t1,[ ]+256 +[ ]+ac:[ ]+2ac401a2[ ]+preld[ ]+0x2,[ ]+\$t1,[ ]+256 [ ]+b0:[ ]+382c39a2[ ]+preldx[ ]+0x2,[ ]+\$t1,[ ]+\$t2 -[ ]+b4:[ ]+2b048d8a[ ]+fld.s[ ]+\$ft2,[ ]+\$t0,[ ]+291\(0x123\) -[ ]+b8:[ ]+2b448d8a[ ]+fst.s[ ]+\$ft2,[ ]+\$t0,[ ]+291\(0x123\) +[ ]+b4:[ ]+2b048d8a[ ]+fld.s[ ]+\$ft2,[ ]+\$t0,[ ]+291 +[ ]+b8:[ ]+2b448d8a[ ]+fst.s[ ]+\$ft2,[ ]+\$t0,[ ]+291 diff --git a/gas/testsuite/gas/loongarch/imm_op.d b/gas/testsuite/gas/loongarch/imm_op.d index a017aaf5bf7..3d4cba45586 100644 --- a/gas/testsuite/gas/loongarch/imm_op.d +++ b/gas/testsuite/gas/loongarch/imm_op.d @@ -8,20 +8,20 @@ Disassembly of section .text: 00000000.* <.text>: [ ]+0:[ ]+020000a4 [ ]+slti[ ]+[ ]+\$a0, \$a1, 0 -[ ]+4:[ ]+021ffca4 [ ]+slti[ ]+[ ]+\$a0, \$a1, 2047\(0x7ff\) -[ ]+8:[ ]+022004a4 [ ]+slti[ ]+[ ]+\$a0, \$a1, -2047\(0x801\) +[ ]+4:[ ]+021ffca4 [ ]+slti[ ]+[ ]+\$a0, \$a1, 2047 +[ ]+8:[ ]+022004a4 [ ]+slti[ ]+[ ]+\$a0, \$a1, -2047 [ ]+c:[ ]+024000a4 [ ]+sltui[ ]+[ ]+\$a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52i.d[ ]+[ ]+\$a0, \$a1, -2047 [ ]+3c:[ ]+034000a4 [ ]+andi[ ]+[ ]+\$a0, \$a1, 0x0 [ ]+40:[ ]+035ffca4 [ ]+andi[ ]+[ ]+\$a0, \$a1, 0x7ff [ ]+44:[ ]+038000a4 [ ]+ori[ ]+[ ]+\$a0, \$a1, 0x0 @@ -29,20 +29,20 @@ Disassembly of section .text: [ ]+4c:[ ]+03c000a4 [ ]+xori[ ]+[ ]+\$a0, \$a1, 0x0 [ ]+50:[ ]+03dffca4 [ ]+xori[ ]+[ ]+\$a0, \$a1, 0x7ff [ ]+54:[ ]+100000a4 [ ]+addu16i.d[ ]+[ ]+\$a0, \$a1, 0 -[ ]+58:[ ]+11fffca4 [ ]+addu16i.d[ ]+[ ]+\$a0, \$a1, 32767\(0x7fff\) -[ ]+5c:[ ]+120004a4 [ ]+addu16i.d[ ]+[ ]+\$a0, \$a1, -32767\(0x8001\) +[ ]+58:[ ]+11fffca4 [ ]+addu16i.d[ ]+[ ]+\$a0, \$a1, 32767 +[ ]+5c:[ ]+120004a4 [ ]+addu16i.d[ ]+[ ]+\$a0, \$a1, -32767 [ ]+60:[ ]+14000004 [ ]+lu12i.w[ ]+[ ]+\$a0, 0 -[ ]+64:[ ]+14ffffe4 [ ]+lu12i.w[ ]+[ ]+\$a0, 524287\(0x7ffff\) -[ ]+68:[ ]+17000024 [ ]+lu32i.d[ ]+[ ]+\$a0, -524287\(0x80001\) +[ ]+64:[ ]+14ffffe4 [ ]+lu12i.w[ ]+[ ]+\$a0, 524287 +[ ]+68:[ ]+17000024 [ ]+lu32i.d[ ]+[ ]+\$a0, -524287 [ ]+6c:[ ]+18000004 [ ]+pcaddi[ ]+[ ]+\$a0, 0 -[ ]+70:[ ]+18ffffe4 [ ]+pcaddi[ ]+[ ]+\$a0, 524287\(0x7ffff\) -[ ]+74:[ ]+19000024 [ ]+pcaddi[ ]+[ ]+\$a0, -524287\(0x80001\) +[ ]+70:[ ]+18ffffe4 [ ]+pcaddi[ ]+[ ]+\$a0, 524287 +[ ]+74:[ ]+19000024 [ ]+pcaddi[ ]+[ ]+\$a0, -524287 [ ]+78:[ ]+1a000004 [ ]+pcalau12i[ ]+[ ]+\$a0, 0 -[ ]+7c:[ ]+1affffe4 [ ]+pcalau12i[ ]+[ ]+\$a0, 524287\(0x7ffff\) -[ ]+80:[ ]+1b000024 [ ]+pcalau12i[ ]+[ ]+\$a0, -524287\(0x80001\) +[ ]+7c:[ ]+1affffe4 [ ]+pcalau12i[ ]+[ ]+\$a0, 524287 +[ ]+80:[ ]+1b000024 [ ]+pcalau12i[ ]+[ ]+\$a0, -524287 [ ]+84:[ ]+1c000004 [ ]+pcaddu12i[ ]+[ ]+\$a0, 0 -[ ]+88:[ ]+1cffffe4 [ ]+pcaddu12i[ ]+[ ]+\$a0, 524287\(0x7ffff\) -[ ]+8c:[ ]+1d000024 [ ]+pcaddu12i[ ]+[ ]+\$a0, -524287\(0x80001\) +[ ]+88:[ ]+1cffffe4 [ ]+pcaddu12i[ ]+[ ]+\$a0, 524287 +[ ]+8c:[ ]+1d000024 [ ]+pcaddu12i[ ]+[ ]+\$a0, -524287 [ ]+90:[ ]+1e000004 [ ]+pcaddu18i[ ]+[ ]+\$a0, 0 -[ ]+94:[ ]+1effffe4 [ ]+pcaddu18i[ ]+[ ]+\$a0, 524287\(0x7ffff\) -[ ]+98:[ ]+1f000024 [ ]+pcaddu18i[ ]+[ ]+\$a0, -524287\(0x80001\) +[ ]+94:[ ]+1effffe4 [ ]+pcaddu18i[ ]+[ ]+\$a0, 524287 +[ ]+98:[ ]+1f000024 [ ]+pcaddu18i[ ]+[ ]+\$a0, -524287 diff --git a/gas/testsuite/gas/loongarch/jmp_op.d b/gas/testsuite/gas/loongarch/jmp_op.d index 0ce804b831c..cc544f11ca3 100644 --- a/gas/testsuite/gas/loongarch/jmp_op.d +++ b/gas/testsuite/gas/loongarch/jmp_op.d @@ -8,43 +8,43 @@ Disassembly of section .text: 00000000.* <.L1>: [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]+bltu[ ]+\$a1,[ ]+\$a0,[ ]+-72[ ]+#[ ]+0[ ]+<\.L1> [ ]+48:[ ]+R_LARCH_B16[ ]+\.L1 -[ ]+4c:[ ]+6fffb485[ ]+bgeu[ ]+\$a0,[ ]+\$a1,[ ]+-76\(0x3ffb4\)[ ]+#[ ]+0[ ]+<\.L1> +[ ]+4c:[ ]+6fffb485[ ]+bgeu[ ]+\$a0,[ ]+\$a1,[ ]+-76[ ]+#[ ]+0[ ]+<\.L1> [ ]+4c:[ ]+R_LARCH_B16[ ]+\.L1 -[ ]+50:[ ]+6fffb0a4[ ]+bgeu[ ]+\$a1,[ ]+\$a0,[ ]+-80\(0x3ffb0\)[ ]+#[ ]+0[ ]+<\.L1> +[ ]+50:[ ]+6fffb0a4[ ]+bgeu[ ]+\$a1,[ ]+\$a0,[ ]+-80[ ]+#[ ]+0[ ]+<\.L1> [ ]+50:[ ]+R_LARCH_B16[ ]+\.L1 [ ]+54:[ ]+4c000020[ ]+ret[ ]+ diff --git a/gas/testsuite/gas/loongarch/load_store_op.d b/gas/testsuite/gas/loongarch/load_store_op.d index fc15773c1f4..e1b4dea1851 100644 --- a/gas/testsuite/gas/loongarch/load_store_op.d +++ b/gas/testsuite/gas/loongarch/load_store_op.d @@ -8,69 +8,69 @@ Disassembly of section .text: 00000000.* <.text>: [ ]+0:[ ]+200000a4 [ ]+ll.w[ ]+[ ]+\$a0, \$a1, 0 -[ ]+4:[ ]+203ffca4 [ ]+ll.w[ ]+[ ]+\$a0, \$a1, 16380\(0x3ffc\) +[ ]+4:[ ]+203ffca4 [ ]+ll.w[ ]+[ ]+\$a0, \$a1, 16380 [ ]+8:[ ]+210000a4 [ ]+sc.w[ ]+[ ]+\$a0, \$a1, 0 -[ ]+c:[ ]+213ffca4 [ ]+sc.w[ ]+[ ]+\$a0, \$a1, 16380\(0x3ffc\) +[ ]+c:[ ]+213ffca4 [ ]+sc.w[ ]+[ ]+\$a0, \$a1, 16380 [ ]+10:[ ]+220000a4 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a0, \$a1, -2047 [ ]+f4:[ ]+2bc000a0 [ ]+fst.d[ ]+[ ]+\$fa0, \$a1, 0 -[ ]+f8:[ ]+2bdffca0 [ ]+fst.d[ ]+[ ]+\$fa0, \$a1, 2047\(0x7ff\) -[ ]+fc:[ ]+2be004a0 [ ]+fst.d[ ]+[ ]+\$fa0, \$a1, -2047\(0x801\) +[ ]+f8:[ ]+2bdffca0 [ ]+fst.d[ ]+[ ]+\$fa0, \$a1, 2047 +[ ]+fc:[ ]+2be004a0 [ ]+fst.d[ ]+[ ]+\$fa0, \$a1, -2047 100:[ ]+380018a4 [ ]+ldx.b[ ]+[ ]+\$a0, \$a1, \$a2 104:[ ]+380418a4 [ ]+ldx.h[ ]+[ ]+\$a0, \$a1, \$a2 108:[ ]+380818a4 [ ]+ldx.w[ ]+[ ]+\$a0, \$a1, \$a2 diff --git a/gas/testsuite/gas/loongarch/macro_op.d b/gas/testsuite/gas/loongarch/macro_op.d index 3f6518eddb0..32860864704 100644 --- a/gas/testsuite/gas/loongarch/macro_op.d +++ b/gas/testsuite/gas/loongarch/macro_op.d @@ -9,9 +9,9 @@ Disassembly of section .text: 00000000.* <.text>: [ ]+0:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) +[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1 [ ]+8:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) +[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1 [ ]+10:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+10:[ ]+R_LARCH_GOT_PC_HI20[ ]+\.L1 [ ]+10:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/gas/testsuite/gas/loongarch/macro_op_32.d b/gas/testsuite/gas/loongarch/macro_op_32.d index 5ac15fdfea8..188026a5780 100644 --- a/gas/testsuite/gas/loongarch/macro_op_32.d +++ b/gas/testsuite/gas/loongarch/macro_op_32.d @@ -9,9 +9,9 @@ Disassembly of section .text: 00000000.* <.L1>: [ ]+0:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) +[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1 [ ]+8:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) +[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1 [ ]+10:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+10:[ ]+R_LARCH_GOT_PC_HI20[ ]+.L1 [ ]+10:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/gas/testsuite/gas/loongarch/privilege_op.d b/gas/testsuite/gas/loongarch/privilege_op.d index 12d4790a027..73925f21a37 100644 --- a/gas/testsuite/gas/loongarch/privilege_op.d +++ b/gas/testsuite/gas/loongarch/privilege_op.d @@ -15,10 +15,10 @@ Disassembly of section .text: [ ]+14:[ ]+04fffca4 [ ]+csrxchg[ ]+[ ]+\$a0, \$a1, 0x3fff [ ]+18:[ ]+060000a0 [ ]+cacop[ ]+[ ]+0x0, \$a1, 0 [ ]+1c:[ ]+060000bf [ ]+cacop[ ]+[ ]+0x1f, \$a1, 0 -[ ]+20:[ ]+061ffca0 [ ]+cacop[ ]+[ ]+0x0, \$a1, 2047\(0x7ff\) -[ ]+24:[ ]+061ffcbf [ ]+cacop[ ]+[ ]+0x1f, \$a1, 2047\(0x7ff\) -[ ]+28:[ ]+062004a0 [ ]+cacop[ ]+[ ]+0x0, \$a1, -2047\(0x801\) -[ ]+2c:[ ]+062004bf [ ]+cacop[ ]+[ ]+0x1f, \$a1, -2047\(0x801\) +[ ]+20:[ ]+061ffca0 [ ]+cacop[ ]+[ ]+0x0, \$a1, 2047 +[ ]+24:[ ]+061ffcbf [ ]+cacop[ ]+[ ]+0x1f, \$a1, 2047 +[ ]+28:[ ]+062004a0 [ ]+cacop[ ]+[ ]+0x0, \$a1, -2047 +[ ]+2c:[ ]+062004bf [ ]+cacop[ ]+[ ]+0x1f, \$a1, -2047 [ ]+30:[ ]+064000a4 [ ]+lddir[ ]+[ ]+\$a0, \$a1, 0x0 [ ]+34:[ ]+0643fca4 [ ]+lddir[ ]+[ ]+\$a0, \$a1, 0xff [ ]+38:[ ]+064400a0 [ ]+ldpte[ ]+[ ]+\$a1, 0x0 diff --git a/gas/testsuite/gas/loongarch/uleb128.d b/gas/testsuite/gas/loongarch/uleb128.d index 41ed8ff870f..df66587b692 100644 --- a/gas/testsuite/gas/loongarch/uleb128.d +++ b/gas/testsuite/gas/loongarch/uleb128.d @@ -16,7 +16,7 @@ Disassembly of section .data: 0000000000000005[ ]+: [ ]+\.\.\. [ ]+81:[ ]+ff040000[ ]+0xff040000 -[ ]+85:[ ]+cacop[ ]+0x1f,[ ]+\$t3,[ ]+1\(0x1\) +[ ]+85:[ ]+cacop[ ]+0x1f,[ ]+\$t3,[ ]+1 0000000000000086[ ]+: [ ]+86:[ ]+07060005[ ]+0x07060005 diff --git a/gas/testsuite/gas/loongarch/vector.d b/gas/testsuite/gas/loongarch/vector.d index f5139bfc525..1a092bca3b8 100644 --- a/gas/testsuite/gas/loongarch/vector.d +++ b/gas/testsuite/gas/loongarch/vector.d @@ -116,30 +116,30 @@ Disassembly of section .text: [ ]+1a4:[ ]+0caa8820[ ]+xvfcmp.sor.d[ ]+\$xr0,[ ]+\$xr1,[ ]+\$xr2 [ ]+1a8:[ ]+0cac0820[ ]+xvfcmp.cune.d[ ]+\$xr0,[ ]+\$xr1,[ ]+\$xr2 [ ]+1ac:[ ]+0cac8820[ ]+xvfcm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+77dc0420[ ]+xvnori.b[ ]+\$xr0,[ ]+\$xr1,[ ]+0x1 -[ ]+168c:[ ]+77e00020[ ]+xvldi[ ]+\$xr0,[ ]+1\(0x1\) -[ ]+1690:[ ]+77e18020[ ]+xvldi[ ]+\$xr0,[ ]+3073\(0xc01\) -[ ]+1694:[ ]+77e08020[ ]+xvldi[ ]+\$xr0,[ ]+1025\(0x401\) -[ ]+1698:[ ]+77e10020[ ]+xvldi[ ]+\$xr0,[ ]+2049\(0x801\) -[ ]+169c:[ ]+77e00020[ ]+xvldi[ ]+\$xr0,[ ]+1\(0x1\) +[ ]+168c:[ ]+77e00020[ ]+xvldi[ ]+\$xr0,[ ]+1 +[ ]+1690:[ ]+77e18020[ ]+xvldi[ ]+\$xr0,[ ]+3073 +[ ]+1694:[ ]+77e08020[ ]+xvldi[ ]+\$xr0,[ ]+1025 +[ ]+1698:[ ]+77e10020[ ]+xvldi[ ]+\$xr0,[ ]+2049 +[ ]+169c:[ ]+77e00020[ ]+xvldi[ ]+\$xr0,[ ]+1 [ ]+16a0:[ ]+77e40420[ ]+xvpermi.w[ ]+\$xr0,[ ]+\$xr1,[ ]+0x1 [ ]+16a4:[ ]+77e80420[ ]+xvpermi.d[ ]+\$xr0,[ ]+\$xr1,[ ]+0x1 [ ]+16a8:[ ]+77ec0420[ ]+xvpermi.q[ ]+\$xr0,[ ]+\$xr1,[ ]+0x1 diff --git a/ld/testsuite/ld-loongarch-elf/jmp_op.d b/ld/testsuite/ld-loongarch-elf/jmp_op.d index be8290711a5..231d780923e 100644 --- a/ld/testsuite/ld-loongarch-elf/jmp_op.d +++ b/ld/testsuite/ld-loongarch-elf/jmp_op.d @@ -8,43 +8,43 @@ Disassembly of section .text: 00000000.* <.L1>: [ ]+0:[ ]+03400000[ ]+andi[ ]+\$zero,[ ]+\$zero,[ ]+0x0 -[ ]+4:[ ]+63fffc04[ ]+blt[ ]+\$zero,[ ]+\$a0,[ ]+-4\(0x3fffc\)[ ]+#[ ]+0[ ]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L1 -[ ]+4c:[ ]+6fffb485[ ]+bgeu[ ]+\$a0,[ ]+\$a1,[ ]+-76\(0x3ffb4\)[ ]+#[ ]+0[ ]+<.L1> +[ ]+4c:[ ]+6fffb485[ ]+bgeu[ ]+\$a0,[ ]+\$a1,[ ]+-76[ ]+#[ ]+0[ ]+<.L1> [ ]+4c:[ ]+R_LARCH_B16[ ]+.L1 -[ ]+50:[ ]+6fffb0a4[ ]+bgeu[ ]+\$a1,[ ]+\$a0,[ ]+-80\(0x3ffb0\)[ ]+#[ ]+0[ ]+<.L1> +[ ]+50:[ ]+6fffb0a4[ ]+bgeu[ ]+\$a1,[ ]+\$a0,[ ]+-80[ ]+#[ ]+0[ ]+<.L1> [ ]+50:[ ]+R_LARCH_B16[ ]+.L1 [ ]+54:[ ]+4c000020[ ]+jirl[ ]+\$zero,[ ]+\$ra,[ ]+0 diff --git a/ld/testsuite/ld-loongarch-elf/macro_op.d b/ld/testsuite/ld-loongarch-elf/macro_op.d index c7f332e7c9d..edc71bc0dbf 100644 --- a/ld/testsuite/ld-loongarch-elf/macro_op.d +++ b/ld/testsuite/ld-loongarch-elf/macro_op.d @@ -8,9 +8,9 @@ Disassembly of section .text: 00000000.* <.L1>: [ ]+0:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) +[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1 [ ]+8:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) +[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1 [ ]+10:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+10:[ ]+R_LARCH_GOT_PC_HI20[ ]+.L1 [ ]+10:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/ld/testsuite/ld-loongarch-elf/macro_op_32.d b/ld/testsuite/ld-loongarch-elf/macro_op_32.d index 5ac15fdfea8..188026a5780 100644 --- a/ld/testsuite/ld-loongarch-elf/macro_op_32.d +++ b/ld/testsuite/ld-loongarch-elf/macro_op_32.d @@ -9,9 +9,9 @@ Disassembly of section .text: 00000000.* <.L1>: [ ]+0:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) +[ ]+4:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1 [ ]+8:[ ]+00150004[ ]+move[ ]+\$a0,[ ]+\$zero -[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1\(0xfff\) +[ ]+c:[ ]+02bffc04[ ]+li\.w[ ]+\$a0,[ ]+-1 [ ]+10:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0,[ ]+0 [ ]+10:[ ]+R_LARCH_GOT_PC_HI20[ ]+.L1 [ ]+10:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/opcodes/loongarch-dis.c b/opcodes/loongarch-dis.c index 11e410f176a..c45c4fc617c 100644 --- a/opcodes/loongarch-dis.c +++ b/opcodes/loongarch-dis.c @@ -192,13 +192,7 @@ dis_one_arg (char esc1, char esc2, const char *bit_field, style = dis_style_immediate; break; } - if (imm == 0) - info->fprintf_styled_func (info->stream, style, "%d", imm); - else - { - info->fprintf_styled_func (info->stream, style, "%d", imm); - info->fprintf_styled_func (info->stream, dis_style_text, "(0x%x)", u_imm); - } + info->fprintf_styled_func (info->stream, style, "%d", imm); switch (esc2) { case 'b': From patchwork Thu Jun 29 16:35:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WANG Xuerui X-Patchwork-Id: 114360 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9765401vqr; Thu, 29 Jun 2023 09:37:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/gydKZAGvJbNwNsIm+2cybEnBDfGz2v6bhTgUCJmldpGFpPMOp80BqYvaA9/kxR2h16+j X-Received: by 2002:a17:907:3688:b0:96a:2acf:61e1 with SMTP id bi8-20020a170907368800b0096a2acf61e1mr34702365ejc.64.1688056625002; Thu, 29 Jun 2023 09:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688056624; cv=none; d=google.com; s=arc-20160816; b=wYyydu3GP31KBy53zlTQXCna5ZU8qFWe5Q8TYujfFMAvB6tisfTyHm3Ze6rLJa9vx8 o56noB1YQ6aN3+SDDyBrkClDPUQ9MOQbpa+UM74VgUEHTeidWQDwfvDiaVyazhI9tKq4 SBlOLs7kKYjohmvnP3EGh+gtU3RhpGXiGavOyxv6JnNHv1lpMtoJ7r5gUhqfzHvDazu9 53Jcap/Lkj3hsPIcvVHLfdBvrya3/vyxQSvPWTyuUEeC6GX6/ehCh7qQhtkffN75Lw1y 37ZR6v9GlLdLzQDkumu2+RnV+ESjol07YH8gQLJrr6n7kXZlzhuBOKO2KpycWAh5pqcn lBVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=aNeVRNN3vQAOTuRFxF3vp/a4evOG8B4tsRWfBquF75Y=; fh=F52lMKP/ag7PTpjpGsg79bnedhkoffS1BBUct4g/1x0=; b=AfcxGil4YxxcnY6rbwhhGzLe8SdZ/AaG3eewHsmCLxU0ErOaLy+QB1Mw7lDlX7gz4S Faj3SixCtL1NSPCQlgdok89yMW0zbO43vkL59xZqNezaTyjE+TVWD3upPaqNby5+xsqV aoZkKG6ZtviEU4K4N+2N43Qbx2gAyyaOOC1JKThKIEcAfqqaNACycEP6LANpVtpywhxE TJdhKJlsUn748ly0rZurtw0ANv6+s5ti/4u+AGcApvuYsGlp3FXryxeYmC9EHgohC/2Q 95prKTMNO7DwpDl0SX3bu97AaIcr3iq1AYgq2jw177QklPzC0YBqmkbvs89+FsSlpy89 uyiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=eUyc2+Tf; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ox27-20020a170907101b00b00988883b37b4si6838220ejb.882.2023.06.29.09.37.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 09:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=eUyc2+Tf; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 224463854831 for ; Thu, 29 Jun 2023 16:36:09 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by sourceware.org (Postfix) with ESMTPS id 58DEC3858C41 for ; Thu, 29 Jun 2023 16:35:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58DEC3858C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=xen0n.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xen0n.name DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1688056520; bh=I4OTJj2Y0ZTuoH2Oc44JERMGXd0uhTQf0EtkzCG2qFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eUyc2+TfkznMXOi+rsR6igWfQ12XYYMHtCgyLOQaqXJij2B3IbP1nEPVMBNx2kshN wF7XLjSREVGSo6QEHkuMjDXtLnZ5UvuW8C2POqiRISw2yadg71kUyOsF5QhL94+kKj bQkiI3/t6yMINmmlMWNGA1fdhylow82fLsgC0Jhk= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 2401060148; Fri, 30 Jun 2023 00:35:20 +0800 (CST) From: WANG Xuerui To: binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , Lulu Cheng , Fangrui Song , Xi Ruoyao , WANG Xuerui Subject: [PATCH v7 6/7] opcodes/loongarch: print unrecognized insn words with the .word directive Date: Fri, 30 Jun 2023 00:35:03 +0800 Message-Id: <20230629163504.1331025-7-i.swmail@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230629163504.1331025-1-i.swmail@xen0n.name> References: <20230629163504.1331025-1-i.swmail@xen0n.name> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770055663479767563?= X-GMAIL-MSGID: =?utf-8?q?1770055663479767563?= From: WANG Xuerui For better round-trip fidelity and readability in general. gas/ChangeLog: * testsuite/gas/loongarch/uleb128.d: Update test case. * testsuite/gas/loongarch/raw-insn.d: New test. * testsuite/gas/loongarch/raw-insn.s: Likewise. opcodes/ChangeLog: * loongarch-dis.c (disassemble_one): Print ".word" if !opc. Signed-off-by: WANG Xuerui --- gas/testsuite/gas/loongarch/raw-insn.d | 11 +++++++++++ gas/testsuite/gas/loongarch/raw-insn.s | 7 +++++++ gas/testsuite/gas/loongarch/uleb128.d | 20 ++++++++++---------- opcodes/loongarch-dis.c | 1 + 4 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 gas/testsuite/gas/loongarch/raw-insn.d create mode 100644 gas/testsuite/gas/loongarch/raw-insn.s diff --git a/gas/testsuite/gas/loongarch/raw-insn.d b/gas/testsuite/gas/loongarch/raw-insn.d new file mode 100644 index 00000000000..64980e47f7b --- /dev/null +++ b/gas/testsuite/gas/loongarch/raw-insn.d @@ -0,0 +1,11 @@ +#as: +#objdump: -dr + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 : +[ ]+0:[ ]+00000000[ ]+.word[ ]+0x00000000 +[ ]+4:[ ]+feedf00d[ ]+.word[ ]+0xfeedf00d diff --git a/gas/testsuite/gas/loongarch/raw-insn.s b/gas/testsuite/gas/loongarch/raw-insn.s new file mode 100644 index 00000000000..528b15263ae --- /dev/null +++ b/gas/testsuite/gas/loongarch/raw-insn.s @@ -0,0 +1,7 @@ +target: + .word 0 + # Given how the LoongArch encoding space is apparently centrally- + # managed and sequentially allocated in chunks of prefixes, it is + # highly unlikely this would become a valid LoongArch instruction in + # the foreseeable future. + .word 0xfeedf00d diff --git a/gas/testsuite/gas/loongarch/uleb128.d b/gas/testsuite/gas/loongarch/uleb128.d index df66587b692..ad67ded9e7d 100644 --- a/gas/testsuite/gas/loongarch/uleb128.d +++ b/gas/testsuite/gas/loongarch/uleb128.d @@ -8,29 +8,29 @@ Disassembly of section .data: 00000000.* : -[ ]+0:[ ]+80030201[ ]+0x80030201 +[ ]+0:[ ]+80030201[ ]+\.word[ ]+0x80030201 [ ]+3:[ ]+R_LARCH_ADD_ULEB128[ ]+L2 [ ]+3:[ ]+R_LARCH_SUB_ULEB128[ ]+L1 [ ]+\.\.\. 0000000000000005[ ]+: [ ]+\.\.\. -[ ]+81:[ ]+ff040000[ ]+0xff040000 +[ ]+81:[ ]+ff040000[ ]+\.word[ ]+0xff040000 [ ]+85:[ ]+cacop[ ]+0x1f,[ ]+\$t3,[ ]+1 0000000000000086[ ]+: -[ ]+86:[ ]+07060005[ ]+0x07060005 -[ ]+8a:[ ]+0x00008080 +[ ]+86:[ ]+07060005[ ]+\.word[ ]+0x07060005 +[ ]+8a:[ ]+\.word[ ]+0x00008080 [ ]+8a:[ ]+R_LARCH_ADD_ULEB128[ ]+L4 [ ]+8a:[ ]+R_LARCH_SUB_ULEB128[ ]+L3 000000000000008d[ ]+: [ ]+\.\.\. -[ ]+4089:[ ]+ff080000[ ]+0xff080000 -[ ]+408d:[ ]+0x09ffffff +[ ]+4089:[ ]+ff080000[ ]+\.word[ ]+0xff080000 +[ ]+408d:[ ]+\.word[ ]+0x09ffffff 0000000000004090[ ]+: -[ ]+4090:[ ]+09090909[ ]+0x09090909 -[ ]+4094:[ ]+09090909[ ]+0x09090909 -[ ]+4098:[ ]+09090909[ ]+0x09090909 -[ ]+409c:[ ]+09090909[ ]+0x09090909 +[ ]+4090:[ ]+09090909[ ]+\.word[ ]+0x09090909 +[ ]+4094:[ ]+09090909[ ]+\.word[ ]+0x09090909 +[ ]+4098:[ ]+09090909[ ]+\.word[ ]+0x09090909 +[ ]+409c:[ ]+09090909[ ]+\.word[ ]+0x09090909 diff --git a/opcodes/loongarch-dis.c b/opcodes/loongarch-dis.c index c45c4fc617c..8d72519be9f 100644 --- a/opcodes/loongarch-dis.c +++ b/opcodes/loongarch-dis.c @@ -259,6 +259,7 @@ disassemble_one (insn_t insn, struct disassemble_info *info) if (!opc) { info->insn_type = dis_noninsn; + info->fprintf_styled_func (info->stream, dis_style_assembler_directive, ".word\t\t"); info->fprintf_styled_func (info->stream, dis_style_immediate, "0x%08x", insn); return; } From patchwork Thu Jun 29 16:35:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WANG Xuerui X-Patchwork-Id: 114364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9767539vqr; Thu, 29 Jun 2023 09:40:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlEXQoMdSzeb2G3DzmmpIcGpx0CBR/5t5LuA6xU8fbCGKG8cqfce0zC+/7WXACeYLLT56LZA X-Received: by 2002:a17:906:224a:b0:992:1653:3402 with SMTP id 10-20020a170906224a00b0099216533402mr639093ejr.25.1688056842923; Thu, 29 Jun 2023 09:40:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688056842; cv=none; d=google.com; s=arc-20160816; b=OGF7XYTbs1AtMgGimeAfjasevoiSU/8/6KyUaOnCotZcNPZnFJbrAlHi3xdokGtBmZ r2xx2mau16rYBaVAt6tzvyHIpV9aZas8Ge6eNe+DRrU4kuew0lxuubvd9AZ/kWhUeNR1 OY7tYpg5GQrCLHsqKq2a/fImtn4s+6i2iHUqsfrRWQydIvk21lg2peYJ7+oRS4hEANdR dCn2LrpRibtudd4DgwrYWVC2TM1vboqnd4qfWICYG8ISQ77AYo1Q3Y+ppOPXqpGOFVka 9Zl+Y5J3uSmS9bMgy+KGPiW9umNef2svRIss5xW3K+sfM7u4fxap2kNKG2GW8mkcDYFI iwQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=il10b5rI0VdduM8A6nNvwgzP/9o88HYKaCmanyKBQaI=; fh=F52lMKP/ag7PTpjpGsg79bnedhkoffS1BBUct4g/1x0=; b=Q5oV0iNq/EDt/jQ5LEJr8MpOwYdGIGQz0FBq84k+CxCqInjgxhb9WQcIOrwUGbJnzP AQrW1xaCMjflpuzSCu/ze549vqwehxXeW1D6TzeNYH3PBkdPrQKITt4CBq0iKi3t9FHZ 4sjCNa48H+8Y4iePjKsBRWJoHW9PUUo2JoOwL6XvHq4sn/TN1og6vRn6v77PAhmbXtpV ovHvaLLzg++lR24yXehldNS3qudQfjsCZiqfOKStEEXWb5hI2kQx1aiPvAwrc5aQRMW+ npwiMUnXLpBphPwecJ+OKbsEZbxB/roUzC6hVJ1/bPW3TePF6woivVbk/yLxkyEe0m0o zSdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=FP8ifkRI; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b10-20020a170906490a00b009875697d993si7468192ejq.555.2023.06.29.09.40.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 09:40:42 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=FP8ifkRI; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24D0C3853D1A for ; Thu, 29 Jun 2023 16:37:25 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by sourceware.org (Postfix) with ESMTPS id 8A3A13858410 for ; Thu, 29 Jun 2023 16:35:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A3A13858410 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=xen0n.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xen0n.name DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1688056523; bh=LDqtD2ZhaaY05+NWAeSKe7dd0iMowAQwfyWF1w5KDO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FP8ifkRIJbG8uis4pk/W94EC3BfxIw2+xbPdtaO33a+tA6dB5lqM/L7addULABt5y AC3CHpwDyMjr0kCeYnVzRX4EYRoPZ4ppl7OQZ6U64iQk5KdIwBeleZdxcO4+mpffEd DnyJoPSxF7V3e8jHfVZLGu8VOgsCvncyezyRo/Kk= Received: from ld50.lan (unknown [101.88.25.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id B8AE560103; Fri, 30 Jun 2023 00:35:22 +0800 (CST) From: WANG Xuerui To: binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , Lulu Cheng , Fangrui Song , Xi Ruoyao , WANG Xuerui Subject: [PATCH v7 7/7] LoongArch: Deprecate $v[01], $fv[01] and $x names per spec Date: Fri, 30 Jun 2023 00:35:04 +0800 Message-Id: <20230629163504.1331025-8-i.swmail@xen0n.name> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230629163504.1331025-1-i.swmail@xen0n.name> References: <20230629163504.1331025-1-i.swmail@xen0n.name> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770055892209775514?= X-GMAIL-MSGID: =?utf-8?q?1770055892209775514?= From: WANG Xuerui As outlined in the LoongArch ELF psABI spec [1], it is actually already 2 versions after the initial LoongArch support, and the $v[01] and $fv[01] names should really get sunset by now. In addition, the "$x" name for $r21 was never included in any released version of the ABI spec, and such usages are all fixed to say just $r21 for every project I could think of that accepted a LoongArch port. Plus, the upcoming LSX/LASX support makes use of registers named "$vrNN" and "$xrNN", so having "$vN" and "$x" alongside would almost certainly create confusion for developers. Issue warnings for such usages per the deprecation procedure detailed in the spec, so we can finally remove support in the next release cycle after this. [1]: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html gas/ChangeLog: * config/tc-loongarch.c: Init canonical register ABI name mappings and deprecated register names. (loongarch_args_parser_can_match_arg_helper): Warn in case of deprecated register name usage. * testsuite/gas/loongarch/deprecated_reg_aliases.d: New test. * testsuite/gas/loongarch/deprecated_reg_aliases.l: Likewise. * testsuite/gas/loongarch/deprecated_reg_aliases.s: Likewise. include/ChangeLog: * opcode/loongarch.h: Rename global variables. opcodes/ChangeLog: * loongarch-opc.c: Rename the alternate/deprecated register name mappings, and move $x to the deprecated name map. Signed-off-by: WANG Xuerui --- gas/config/tc-loongarch.c | 42 ++++++++++++++++--- .../gas/loongarch/deprecated_reg_aliases.d | 18 ++++++++ .../gas/loongarch/deprecated_reg_aliases.l | 7 ++++ .../gas/loongarch/deprecated_reg_aliases.s | 5 +++ include/opcode/loongarch.h | 4 +- opcodes/loongarch-opc.c | 8 ++-- 6 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 gas/testsuite/gas/loongarch/deprecated_reg_aliases.d create mode 100644 gas/testsuite/gas/loongarch/deprecated_reg_aliases.l create mode 100644 gas/testsuite/gas/loongarch/deprecated_reg_aliases.s diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index 6e8aa35e282..d23506cd023 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -223,8 +223,12 @@ md_parse_option (int c, const char *arg) return ret; } +static const char *const *r_abi_names = NULL; +static const char *const *f_abi_names = NULL; static struct htab *r_htab = NULL; +static struct htab *r_deprecated_htab = NULL; static struct htab *f_htab = NULL; +static struct htab *f_deprecated_htab = NULL; static struct htab *fc_htab = NULL; static struct htab *fcn_htab = NULL; static struct htab *c_htab = NULL; @@ -272,7 +276,11 @@ loongarch_after_parse_args () /* Init ilp32/lp64 registers names. */ if (!r_htab) r_htab = str_htab_create (), str_hash_insert (r_htab, "", 0, 0); + if (!r_deprecated_htab) + r_deprecated_htab = str_htab_create (), + str_hash_insert (r_deprecated_htab, "", 0, 0); + r_abi_names = loongarch_r_normal_name; for (i = 0; i < ARRAY_SIZE (loongarch_r_normal_name); i++) str_hash_insert (r_htab, loongarch_r_normal_name[i], (void *) (i + 1), 0); @@ -287,7 +295,11 @@ loongarch_after_parse_args () { if (!f_htab) f_htab = str_htab_create (), str_hash_insert (f_htab, "", 0, 0); + if (!f_deprecated_htab) + f_deprecated_htab = str_htab_create (), + str_hash_insert (f_deprecated_htab, "", 0, 0); + f_abi_names = loongarch_f_normal_name; for (i = 0; i < ARRAY_SIZE (loongarch_f_normal_name); i++) str_hash_insert (f_htab, loongarch_f_normal_name[i], (void *) (i + 1), 0); @@ -338,22 +350,24 @@ loongarch_after_parse_args () /* Init lp64 registers alias. */ if (LARCH_opts.ase_lp64) { + r_abi_names = loongarch_r_lp64_name; for (i = 0; i < ARRAY_SIZE (loongarch_r_lp64_name); i++) str_hash_insert (r_htab, loongarch_r_lp64_name[i], (void *) (i + 1), 0); - for (i = 0; i < ARRAY_SIZE (loongarch_r_lp64_name1); i++) - str_hash_insert (r_htab, loongarch_r_lp64_name1[i], (void *) (i + 1), - 0); + for (i = 0; i < ARRAY_SIZE (loongarch_r_lp64_name_deprecated); i++) + str_hash_insert (r_deprecated_htab, loongarch_r_lp64_name_deprecated[i], + (void *) (i + 1), 0); } /* Init float-lp64 registers alias */ if ((LARCH_opts.ase_sf || LARCH_opts.ase_df) && LARCH_opts.ase_lp64) { + f_abi_names = loongarch_f_lp64_name; for (i = 0; i < ARRAY_SIZE (loongarch_f_lp64_name); i++) str_hash_insert (f_htab, loongarch_f_lp64_name[i], (void *) (i + 1), 0); - for (i = 0; i < ARRAY_SIZE (loongarch_f_lp64_name1); i++) - str_hash_insert (f_htab, loongarch_f_lp64_name1[i], + for (i = 0; i < ARRAY_SIZE (loongarch_f_lp64_name_deprecated); i++) + str_hash_insert (f_deprecated_htab, loongarch_f_lp64_name_deprecated[i], (void *) (i + 1), 0); } } @@ -684,6 +698,15 @@ loongarch_args_parser_can_match_arg_helper (char esc_ch1, char esc_ch2, imm = (intptr_t) str_hash_find (r_htab, arg); ip->match_now = 0 < imm; ret = imm - 1; + if (ip->match_now) + break; + /* Handle potential usage of deprecated register aliases. */ + imm = (intptr_t) str_hash_find (r_deprecated_htab, arg); + ip->match_now = 0 < imm; + ret = imm - 1; + if (ip->match_now && !ip->macro_id) + as_warn (_("register alias %s is deprecated, use %s instead"), + arg, r_abi_names[ret]); break; case 'f': switch (esc_ch2) @@ -700,6 +723,15 @@ loongarch_args_parser_can_match_arg_helper (char esc_ch1, char esc_ch2, } ip->match_now = 0 < imm; ret = imm - 1; + if (ip->match_now && !ip->macro_id) + break; + /* Handle potential usage of deprecated register aliases. */ + imm = (intptr_t) str_hash_find (f_deprecated_htab, arg); + ip->match_now = 0 < imm; + ret = imm - 1; + if (ip->match_now) + as_warn (_("register alias %s is deprecated, use %s instead"), + arg, f_abi_names[ret]); break; case 'c': switch (esc_ch2) diff --git a/gas/testsuite/gas/loongarch/deprecated_reg_aliases.d b/gas/testsuite/gas/loongarch/deprecated_reg_aliases.d new file mode 100644 index 00000000000..3ea0806765f --- /dev/null +++ b/gas/testsuite/gas/loongarch/deprecated_reg_aliases.d @@ -0,0 +1,18 @@ +#name: Deprecated register aliases +#as-new: +#objdump: -d +#warning_output: deprecated_reg_aliases.l +#skip: loongarch32-*-* + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0000000000000000 : +[ ]+0:[ ]+14acf125[ ]+lu12i\.w[ ]+\$a1, 354185 +[ ]+4:[ ]+038048a5[ ]+ori[ ]+\$a1, \$a1, 0x12 +[ ]+8:[ ]+16024685[ ]+lu32i\.d[ ]+\$a1, 4660 +[ ]+c:[ ]+08200420[ ]+fmadd\.d[ ]+\$fa0, \$fa1, \$fa1, \$fa0 +[ ]+10:[ ]+380c16a4[ ]+ldx\.d[ ]+\$a0, \$r21, \$a1 +[ ]+14:[ ]+4c000020[ ]+ret[ ]+ diff --git a/gas/testsuite/gas/loongarch/deprecated_reg_aliases.l b/gas/testsuite/gas/loongarch/deprecated_reg_aliases.l new file mode 100644 index 00000000000..b82c209e541 --- /dev/null +++ b/gas/testsuite/gas/loongarch/deprecated_reg_aliases.l @@ -0,0 +1,7 @@ +.*Assembler messages: +.*:2: Warning: register alias \$v1 is deprecated, use \$a1 instead +.*:3: Warning: register alias \$fv0 is deprecated, use \$fa0 instead +.*:3: Warning: register alias \$fv1 is deprecated, use \$fa1 instead +.*:3: Warning: register alias \$fv1 is deprecated, use \$fa1 instead +.*:4: Warning: register alias \$v0 is deprecated, use \$a0 instead +.*:4: Warning: register alias \$x is deprecated, use \$r21 instead diff --git a/gas/testsuite/gas/loongarch/deprecated_reg_aliases.s b/gas/testsuite/gas/loongarch/deprecated_reg_aliases.s new file mode 100644 index 00000000000..7848346e6ae --- /dev/null +++ b/gas/testsuite/gas/loongarch/deprecated_reg_aliases.s @@ -0,0 +1,5 @@ +foo: + li.d $v1, 0x123456789012 + fmadd.d $fv0, $fv1, $fv1, $fa0 + ldx.d $v0, $x, $a1 + ret diff --git a/include/opcode/loongarch.h b/include/opcode/loongarch.h index e9632ad3361..6d399f70a98 100644 --- a/include/opcode/loongarch.h +++ b/include/opcode/loongarch.h @@ -178,10 +178,10 @@ dec2 : [1-9][0-9]? extern const char *const loongarch_r_normal_name[32]; extern const char *const loongarch_r_lp64_name[32]; - extern const char *const loongarch_r_lp64_name1[32]; + extern const char *const loongarch_r_lp64_name_deprecated[32]; extern const char *const loongarch_f_normal_name[32]; extern const char *const loongarch_f_lp64_name[32]; - extern const char *const loongarch_f_lp64_name1[32]; + extern const char *const loongarch_f_lp64_name_deprecated[32]; extern const char *const loongarch_fc_normal_name[4]; extern const char *const loongarch_fc_numeric_name[4]; extern const char *const loongarch_c_normal_name[8]; diff --git a/opcodes/loongarch-opc.c b/opcodes/loongarch-opc.c index 8be227cd9a9..05cf4eb463c 100644 --- a/opcodes/loongarch-opc.c +++ b/opcodes/loongarch-opc.c @@ -45,14 +45,14 @@ const char *const loongarch_r_lp64_name[32] = { "$zero", "$ra", "$tp", "$sp", "$a0", "$a1", "$a2", "$a3", "$a4", "$a5", "$a6", "$a7", "$t0", "$t1", "$t2", "$t3", - "$t4", "$t5", "$t6", "$t7", "$t8", "$x", "$fp", "$s0", + "$t4", "$t5", "$t6", "$t7", "$t8", "$r21","$fp", "$s0", "$s1", "$s2", "$s3", "$s4", "$s5", "$s6", "$s7", "$s8", }; -const char *const loongarch_r_lp64_name1[32] = +const char *const loongarch_r_lp64_name_deprecated[32] = { "", "", "", "", "$v0", "$v1", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "$x", "", "", "", "", "", "", "", "", "", "", }; const char *const loongarch_f_normal_name[32] = @@ -71,7 +71,7 @@ const char *const loongarch_f_lp64_name[32] = "$fs0", "$fs1", "$fs2", "$fs3", "$fs4", "$fs5", "$fs6", "$fs7", }; -const char *const loongarch_f_lp64_name1[32] = +const char *const loongarch_f_lp64_name_deprecated[32] = { "$fv0", "$fv1", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",