)]}'
{
  "commit": "65d67f5bb5cdc02dbbe1dd214db17ad8a90c590c",
  "tree": "be9b39ce9419584fa844ffe8e5a1fe28fb9bb822",
  "parents": [
    "02f7c2a9f319eadfe1146a3835c7c4dad74562bf"
  ],
  "author": {
    "name": "Fangrui Song",
    "email": "i@maskray.me",
    "time": "Tue Mar 10 09:30:51 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Mar 10 09:30:51 2026 -0700"
  },
  "message": "[X86] Fix wrong ImmT in several instructions and add assertion (#185461)\n\nFollow-up to #185254:\nSeveral instructions inherited ImmT\u003dImm8 from *Ii8Base/*Ii8 classes\nwithout having an actual immediate operand. This made\nX86MCCodeEmitter::emitMemModRMByte compute ImmSize\u003d1 instead of 0:\n\n```\n  int ImmSize \u003d !Disp.isImm() \u0026\u0026 X86II::hasImm(TSFlags)\n                    ? X86II::getSizeOfImm(TSFlags)\n                    : 0;\n```\n\nbiasing RIP-relative displacements by one byte (e.g. foo-0x5 instead\nof foo-0x4).\n\nAffected instructions:\n- VCVTHF82PH (via AVX512XDIi8Base): has memory forms, wrong relocations\n- V[U]COMIS{S,D,H}Zrrb (via AVX512P{S,D}Ii8Base): reg-only, latent\n- MMX_MOV{DQ2Q,Q2DQ}rr and variants (via MMXSDIi8/MMXS2SIi8): reg-only,\nlatent\n\nFix by replacing the *Ii8Base/*Ii8 classes with their prefix-only\nequivalents (TB, XD, XS, PD) and setting ExeDomain explicitly where\nneeded.\n\nAdd an assertion in encodeInstruction to catch future TSFlags/operand\nImmType mismatches: after consuming all operands in the Form-specific\nswitch, if `hasImm(TSFlags)` is true but `RemainingOps` is 0 and the\nForm\nisn\u0027t one that handles immediates internally (RawFrm, AddCCFrm,\nRawFrmImm8, RawFrmImm16, RawFrmMemOffs), the assertion fires. For\nexample, `VCOMISDZrrb` has `Form\u003dMRMSrcReg` and `ImmT\u003dImm8` (from\nAVX512PDIi8Base), but after consuming both XMM operands CurOp equals\nNumOps, leaving RemainingOps\u003d0 with no immediate to emit.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cfe5b1094811acf09fdc9a8c595906cf43ea468c",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp",
      "new_id": "f40e41af516fd535fc66cd3cb035296068900593",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp"
    },
    {
      "type": "modify",
      "old_id": "6064c5f0bfd15e0206091929656af3b6eddf201a",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/X86/X86InstrAVX10.td",
      "new_id": "475fa1ec3eaded2d4e2f7f2353529c89530a26bb",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/X86/X86InstrAVX10.td"
    },
    {
      "type": "modify",
      "old_id": "35e424a1879f39db8f021011caf31268d1293502",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/X86/X86InstrAVX512.td",
      "new_id": "aafc5cb3c7ee50d81659d8976e6ac9f7031dc0fe",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/X86/X86InstrAVX512.td"
    },
    {
      "type": "modify",
      "old_id": "1cdf7f9093c17f9eea8cfeae33fe48a25a57a98a",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/X86/X86InstrMMX.td",
      "new_id": "a603e8330c44595689ee492bcf75c0d2d3bb86b6",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/X86/X86InstrMMX.td"
    },
    {
      "type": "rename",
      "old_id": "0ace05122d157e644963baf23704bfd81bc1a404",
      "old_mode": 33188,
      "old_path": "llvm/test/MC/X86/Relocations/avx10.2satcvt.s",
      "new_id": "69730907b0e501bf2dcaf9ecd4022ec2c173ae55",
      "new_mode": 33188,
      "new_path": "llvm/test/MC/X86/Relocations/evex-mem.s",
      "score": 86
    }
  ]
}
