binutils Newspaper
NOVEMBER 30, 2026
mips — Committed

MIPS: Swap INSN_MULT opcode flag for INSN_DIV

Replaces INSN_MULT flag with INSN_DIV for scheduling restrictions on MIPS architecture, simplifying instruction handling.

This change modifies how instruction scheduling restrictions are handled for MIPS multiplication and division operations. It removes the unique INSN_MULT flag, which had an inverse effect on scheduling, and replaces it with the more conventional INSN_DIV flag. This change aims to unify the opcode table and improve interlock optimization for instructions like MTHI and MFLO, especially on the Toshiba TX39 processor, by allowing them to be preceded by instructions that read HI/LO registers.

In Details

The MIPS architecture's opcode table uses flags to denote instruction properties, such as scheduling restrictions. The INSN_MULT flag was an anomaly, indicating when an instruction *could* be preceded by others, unlike most flags that denote a dependency. This change normalizes this by using INSN_DIV for division instructions and adjusting logic in insns_between to correctly handle interlocks for multiplication-related instructions on specific CPUs like the Toshiba TX39, which have unique HI/LO register interlock behaviors.

For Context
INSN_MULT
An opcode flag in the MIPS instruction set used to indicate specific scheduling behaviors related to multiplication instructions.
INSN_DIV
An opcode flag in the MIPS instruction set indicating scheduling restrictions for division instructions.
interlock optimization
Compiler or assembler optimizations that ensure correct instruction sequencing by inserting necessary delays (e.g., NOPs) to avoid pipeline hazards or data dependencies.
Toshiba TX39
A specific MIPS processor that has particular pipeline constraints related to the HI and LO registers, especially concerning division and multiply-add instructions.
HI/LO registers
Special-purpose registers on MIPS processors that store the high and low parts of multiplication or division results.
Filed Under: mipsoptimizationschedulingarchitecture