From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by sourceware.org (Postfix) with ESMTPS id D431138369C8 for ; Wed, 14 Dec 2022 05:47:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D431138369C8 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=1670996828; bh=+eXSM4ZuIIbBHEJ1x74Hs+IhoYf+HYFUjWS2sI1Gg80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0xQ5bgRxRnGs6KMuBim41OQS7o6GSRmGGEUtcihnjuLctkKzyLn12L6n1r3ZnCHv j/joIs7ZKanGIeAZiPpH0+piNUo03ydTFioFmLyRYwkf7a0tV3hITw0Vz66HDRAvuv 4WbanIo1OicRcYQ4d/P3FvPZtnZYuZWIQJhb2kx4= Received: from ld50.lan (unknown [101.88.134.93]) (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 C05F4601A3; Wed, 14 Dec 2022 13:47:08 +0800 (CST) From: WANG Xuerui To: binutils@sourceware.org Cc: Chenghua Xu , Zhensong Liu , Qinggang Meng , Xi Ruoyao , WANG Xuerui Subject: [PATCH v3 6/6] opcodes/loongarch: print unrecognized insn words with the .word directive Date: Wed, 14 Dec 2022 13:47:00 +0800 Message-Id: <20221214054700.2889049-7-i.swmail@xen0n.name> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221214054700.2889049-1-i.swmail@xen0n.name> References: <20221214054700.2889049-1-i.swmail@xen0n.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: WANG Xuerui For better round-trip fidelity and readability in general. --- gas/testsuite/gas/loongarch/raw-insn.d | 11 +++++++++++ gas/testsuite/gas/loongarch/raw-insn.s | 7 +++++++ opcodes/loongarch-dis.c | 1 + 3 files changed, 19 insertions(+) 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/opcodes/loongarch-dis.c b/opcodes/loongarch-dis.c index b73ef43f8ea..7ac2b07465a 100644 --- a/opcodes/loongarch-dis.c +++ b/opcodes/loongarch-dis.c @@ -250,6 +250,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; } -- 2.38.1