MIPS/GAS: Reinstate INSN_MULT interlock optimization

Only integer division instructions in the Toshiba TX39 processor are
unsafe to be preceded by a HI and/or LO register read operation as the
first or second instruction ahead.

This optimization used to be there in GAS, but was silently dropped with
commit 71400594f26d ("Rework MIPS nop-insertion code, add -mfix-vr4130"),
<https://inbox.sourceware.org/binutils/wvnfyz6ch5y.fsf_-_@talisman.cambridge.redhat.com/>,
causing unnecesary NOPs to be emitted ahead of multiplication opcodes.
The INSN_MULT flag used in the opcode table to mark eligible entries was
left behind, unused, but the GAS parts were removed.

Reinstate the missing parts, observing that unlike with other opcode
flags INSN_MULT uses negative logic and marks entries that don't imply
rather than do a data dependency.  Therefore INSN_MULT needs to be
cleared rather than set when no previous instruction is available in
`insns_between'.

Otherwise filler NOPs would fail to be produced for DIV, DIVU, MULO,
MULOU macros preceded by an instruction that reads the HI and/or LO
register, showing as R3900 test regressions:

FAIL: MIPS div (r3900)
FAIL: MIPS div with traps (r3900)
FAIL: MIPS mul (r3900)
FAIL: MIPS mul with traps (r3900)

This peculiarity will be removed with the next change.

Adjust the testsuite for the optimization now re-enabled.

Update the comment in `insns_between' saying that this optimization does
not apply for most targets since this has long become not the case.
6 files changed