binutils Newspaper
NOVEMBER 30, 2026
gas — Proposed

gas: microblaze: test every opcode table entry

Adds comprehensive tests for the MicroBlaze gas opcode table to ensure all instructions are correctly disassembled.

This patch introduces extensive test cases for the MicroBlaze gas opcode table, aiming to cover every instruction. The existing tests were insufficient, only covering a small fraction of the available opcodes and missing certain instruction encodings and variations. The new tests, verified against QEMU and documentation, assemble each instruction with diverse operands and special forms, ensuring accurate disassembly.

In the Thread 1 participant
  1. Samuel Price proposer

    Submitted a patch to significantly expand the test suite for MicroBlaze gas opcodes, ensuring all instructions are tested.

    “The MicroBlaze gas tests disassemble 32 of the 277 instructions in microblaze-opc.h. A mask mistake, where one entry also matches a later entry's encoding, shows up only when someone disassembles the later instruction; the earlier patches of this series fix four.”

In Details

This patch extends the test suite for the MicroBlaze assembler (gas) by creating comprehensive tests for its opcode table. Previously, only a small subset of instructions were tested, leading to potential undiscovered bugs like mask overlaps. The new tests, generated with varied operands and specific instruction forms, are validated against QEMU and architectural documentation (UG984) to ensure the accurate disassembly of all MicroBlaze instructions.

For Context
gas
The GNU Assembler, part of the GNU Binutils package. It translates assembly language code into object files.
MicroBlaze
A soft processor core from Xilinx, designed to be implemented in FPGAs. It has a RISC-like architecture.
opcode table
A data structure within an assembler or disassembler that maps instruction mnemonics and their encodings to their corresponding operations.
disassemble
The process of converting machine code (binary instructions) back into human-readable assembly language.
QEMU
A popular open-source machine emulator and virtualizer that can emulate various hardware architectures, including MicroBlaze.
UG984
A specific user guide or technical reference manual for the MicroBlaze processor.
Filed Under: microblazegastestingdisassembleropcode table