opcodes: microblaze: don't print mbar 17 as sleep
Corrects MicroBlaze opcode masking to distinguish 'mbar' from specific sleep instructions and preserve wait-skip information.
This patch corrects the opcode mask for MicroBlaze ‘mbar’ instructions to prevent misinterpretation. Previously, a shared mask caused ‘mbar’ instructions with specific immediate values (like 17) to be incorrectly displayed as ‘sleep’, losing information about skipped memory waits. By refining the masks and reordering pseudo-instructions, ‘mbar’ now disassembles correctly, and specific sleep instructions remain distinct.
- proposer
Adjusts MicroBlaze opcode masks to correctly differentiate 'mbar' from pseudo-instructions like 'sleep' and retain information about skipped waits.
“OPCODE_MASK_HN, shared by mbar, sleep, hibernate and suspend, compares only the top two bits of mbar's five-bit immediate. objdump therefore prints every mbar with an immediate of 8 or more as hibernate, sleep or suspend, mbar 17 as sleep for example, and drops the low bits, which select the memory waits the instruction skips.”
In Details
This patch refines the opcode matching logic for MicroBlaze instructions in opcodes/microblaze-opc.h. The OPCODE_MASK_HN was too broad, causing mbar instructions with certain immediate values to be incorrectly identified as pseudo-instructions like sleep, hibernate, or suspend. This change updates the masks and reorders the instruction table so that mbar instructions are correctly recognized, and the specific sleep pseudo-instructions retain their distinct entries. This ensures that the disassembler accurately reflects the instruction's intended operation and any associated wait…
- opcode mask
- A bitmask used to isolate specific fields within an instruction's binary encoding for matching purposes.
- MicroBlaze
- A soft processor core from Xilinx, designed to be implemented in FPGAs. It has a RISC-like architecture.
- disassembler
- A program that translates machine code into assembly language.
- pseudo-instruction
- An assembly language construct that does not correspond directly to a single machine instruction but is expanded by the assembler into one or more machine instructions or directives.
- UG984
- A specific user guide or technical reference manual for the MicroBlaze processor.