)]}'
{
  "commit": "f4e41bbd789ebdf105dd4f95b44e7ea1cdd8872c",
  "tree": "d80944d985f361589617c27ca6a83073f5798782",
  "parents": [
    "c98a77f14787760c308352d2f6800ebe5254563b"
  ],
  "author": {
    "name": "Maciej W. Rozycki",
    "email": "macro@orcam.me.uk",
    "time": "Sun Nov 15 10:53:38 2026 +0000"
  },
  "committer": {
    "name": "Maciej W. Rozycki",
    "email": "macro@orcam.me.uk",
    "time": "Sun Nov 15 10:53:38 2026 +0000"
  },
  "message": "MIPS: Correct Toshiba TX39 MADD/MADDU HI/LO instruction flags\n\nToshiba TX39 integer multiply-add instructions suffer from a pipeline\nhazard on the HI and LO registers[1]:\n\n\"The value of the HI and LO registers are undefined for the two\ninstructions immediately preceding a DIV or DIVU instruction.\nAccordingly, do not place a DIV or DIVU instruction as the next\nor next-but-one instruction after a MADD, MADDU, MFHI, or MFLO\ninstruction that reads the HI or LO registers.\"\n\nThis is further asserted in the instruction list for MADD[2]:\n\n\"To guarantee correct operation even if an interrupt occurs, neither of\nthe two instructions following MADD should be DIV or DIVU instructions\nwhich modify the HI and LO register contents.\"\n\nand similarly for MADDU[3].\n\nIn GAS we already handle this hazard correctly in `insns_between\u0027, which\nworks for MFHI and MFLO instructions via their INSN_READ_HI/INSN_READ_LO\nflags, however TX39 MADD and MADDU instructions only have INSN_WRITE_HI\nand INSN_WRITE_LO flags set.  Consequently the hazard is not observed.\n\nAdd the missing INSN_READ_HI/INSN_READ_LO flags then across the family,\nso as to cause extra NOP instructions to be emitted as required to move\nthe instructions affected apart.  Add test coverage.\n\nReferences:\n\n[1] \"32-Bit TX System RISC TX39 Family Architecture\", Toshiba\n    Corporation, Document Number 44137D-0001, Volume \"Architecture\",\n    Section 4.9 \"Restrictions on Instruction Placement\", p. 4-9\n\n[2] same, Appendix A \"Instruction Set Details\", p. A-60\n\n[3] same, p. A-61\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4c6371feb148f09c65109ea81042761f04126861",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/mips/madd.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c80eef0a9e9fb74a6cdf8457a7908480c7e08293",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/mips/madd.s"
    },
    {
      "type": "modify",
      "old_id": "d9aeb1138efddce4c4fb522fa11eb5ea524d0c05",
      "old_mode": 33188,
      "old_path": "gas/testsuite/gas/mips/mips.exp",
      "new_id": "d957396bc70a5e148a41541fd40894628e140974",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/mips/mips.exp"
    },
    {
      "type": "modify",
      "old_id": "1d7d72ae0a71d20e6f83166dc7d8323fc23d105c",
      "old_mode": 33188,
      "old_path": "opcodes/mips-opc.c",
      "new_id": "5479f4ea771a271612b60ffb33bc4453b146870c",
      "new_mode": 33188,
      "new_path": "opcodes/mips-opc.c"
    }
  ]
}
