[PATCH 2/7] opcodes: microblaze: tell wdc.ext.clear from wdc.clear
Samuel Price
thesamprice@gmail.com
Mon Nov 9 04:08:06 GMT 2026
objdump prints "wdc.ext.clear r5, r9" (0x90054c66) as "wdc.clear r5,
r9". The disassembler takes the first entry that matches under its
mask. wdc.clear comes first, and its mask, OPCODE_MASK_H34B
(0xFC0000FF), leaves out the E bit (0x400), the only bit in which the
two differ (UG984, Figure 141).
Use OPCODE_MASK_H35B, which wdc.ext.clear and wdc.ext.flush already
use, for all six wdc entries, and correct its comment. Words with E set
that UG984 names no instruction for now print as .long rather than as
the form without E, and the simulator stops on them instead of running
a no-op. wic keeps OPCODE_MASK_H34B; it has no E bit. I checked these
encodings against UG984 only, since QEMU executes every wdc form alike.
opcodes/
* microblaze-opc.h (OPCODE_MASK_H35B): Correct the comment.
(microblaze_opcodes): Use OPCODE_MASK_H35B for wdc, wdc.clear,
wdc.flush and wdc.clear.ea.
Signed-off-by: Sam Price <thesamprice@gmail.com>
Assisted-by: Claude (Anthropic)
---
opcodes/microblaze-opc.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
index fde7b94e694..756a41a18c2 100644
--- a/opcodes/microblaze-opc.h
+++ b/opcodes/microblaze-opc.h
@@ -97,7 +97,7 @@
#define OPCODE_MASK_H32B 0xFC00F820 /* High 6 bits and bits 16:20 and
bit 26 */
#define OPCODE_MASK_H34B 0xFC0000FF /* High 6 bits and low 8 bits. */
-#define OPCODE_MASK_H35B 0xFC0004FF /* High 6 bits and low 9 bits. */
+#define OPCODE_MASK_H35B 0xFC0004FF /* High 6 bits and bits 21, 24:31. */
#define OPCODE_MASK_H34C 0xFC0007E0 /* High 6 bits and bits 21-26. */
/* New Mask for msrset, msrclr insns. */
@@ -181,12 +181,12 @@ const struct op_code_struct
{"sext8", INST_TYPE_RD_R1, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000060, OPCODE_MASK_H34, sext8, logical_inst },
{"sext16",INST_TYPE_RD_R1, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000061, OPCODE_MASK_H34, sext16, logical_inst },
{"wic", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000068, OPCODE_MASK_H34B, wic, special_inst },
- {"wdc", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000064, OPCODE_MASK_H34B, wdc, special_inst },
- {"wdc.clear", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000066, OPCODE_MASK_H34B, wdcclear, special_inst },
+ {"wdc", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000064, OPCODE_MASK_H35B, wdc, special_inst },
+ {"wdc.clear", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000066, OPCODE_MASK_H35B, wdcclear, special_inst },
{"wdc.ext.clear", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000466, OPCODE_MASK_H35B, wdcextclear, special_inst },
- {"wdc.flush", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000074, OPCODE_MASK_H34B, wdcflush, special_inst },
+ {"wdc.flush", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000074, OPCODE_MASK_H35B, wdcflush, special_inst },
{"wdc.ext.flush", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x90000476, OPCODE_MASK_H35B, wdcextflush, special_inst },
- {"wdc.clear.ea", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x900000E6, OPCODE_MASK_H34B, wdcclearea, special_inst },
+ {"wdc.clear.ea", INST_TYPE_R1_R2_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x900000E6, OPCODE_MASK_H35B, wdcclearea, special_inst },
{"mts", INST_TYPE_SPECIAL_R1, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MTS, 0x9400C000, OPCODE_MASK_H13S, mts, special_inst },
{"mtse", INST_TYPE_SPECIAL_R1, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MTS, 0x9500C000, OPCODE_MASK_H13S, mtse,special_inst },
{"mfs", INST_TYPE_RD_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MFS, 0x94008000, OPCODE_MASK_H23S, mfs, special_inst },
--
2.39.5 (Apple Git-154)
More information about the Binutils
mailing list