)]}'
{
  "commit": "79d72f45a7c9b8b92c7d0452caf968b6709a0d44",
  "tree": "1cfe668a14e35d6787222a7d6ab4ff159af70597",
  "parents": [
    "bb7b70ab85fb9d185d1fa6bad192c90fe9c17ff3"
  ],
  "author": {
    "name": "Hongtao Liu",
    "email": "hongtao.liu@intel.com",
    "time": "Tue Mar 03 06:21:37 2020 -0800"
  },
  "committer": {
    "name": "H.J. Lu",
    "email": "hjl.tools@gmail.com",
    "time": "Tue Mar 03 06:21:37 2020 -0800"
  },
  "message": "x86: Improve -malign-branch\n\nAccording to intel SDM manual, not all compare flag-modifying instructions\nare marcro-fusible with subsequent jcc instructions. For those non-fusible\ninstructions, -malign-branch doesn\u0027t need to align them, only jcc itself\nneeds to be aligned.\n\nHere are 2 restrictions which separate macro-fusible instruction from not\n\nRestriction 1:\nIf TEST/AND/CMP/ADD/SUB/INC/DEC is one of the following format:\n\n   cmp m, imm\n   add m, imm\n   sub m, imm\n   test m, imm\n   and m, imm\n   inc m\n   dec m\n\nit is unfusible with any jcc instruction.\n\nRestriction 2:\n\n/* Table 3-2. Macro-Fusible Instructions in Haswell Microarchitecture\n   Note it also works for Skylake and Cascadelake.\n---------------------------------------------------------------------\n|   JCC   | ADD/SUB/CMP | INC/DEC | TEST/AND |\n| ------  | ----------- | ------- | -------- |\n|   Jo    |      N      |    N    |     Y    |\n|   Jno   |      N      |    N    |     Y    |\n|  Jc/Jb  |      Y      |    N    |     Y    |\n| Jae/Jnb |      Y      |    N    |     Y    |\n|  Je/Jz  |      Y      |    Y    |     Y    |\n| Jne/Jnz |      Y      |    Y    |     Y    |\n| Jna/Jbe |      Y      |    N    |     Y    |\n| Ja/Jnbe |      Y      |    N    |     Y    |\n|   Js    |      N      |    N    |     Y    |\n|   Jns   |      N      |    N    |     Y    |\n|  Jp/Jpe |      N      |    N    |     Y    |\n| Jnp/Jpo |      N      |    N    |     Y    |\n| Jl/Jnge |      Y      |    Y    |     Y    |\n| Jge/Jnl |      Y      |    Y    |     Y    |\n| Jle/Jng |      Y      |    Y    |     Y    |\n| Jg/Jnle |      Y      |    Y    |     Y    |\n\nUpdate maybe_fused_with_jcc_p to check if operands of CMP like instructions\ncan be fused with condition jump.\n\n\t* gas/config/tc-i386.h (i386_tc_frag_data): Add member mf_type.\n\t(TC_FRAG_INIT): Init mf_type.\n\t* gas/config/tc-i386.c (enum mf_jcc_kind): New enum.\n\t(enum mf_cmp_kind): Ditto.\n\t(maybe_fused_with_jcc_p): Add argument mf_cmp_p to get\n\tmf_type of corresponding instructons, exclude unfusible\n\tinstructions.\n\t(add_fused_jcc_padding_frag_p): Likewise.\n\t(add_branch_padding_frag_p): Likewise.\n\t(output_insn): Record mf_type for corresponding instructions.\n\t(i386_macro_fusible_p): New function.\n\t(i386_next_fusible_jcc_frag): Rename from i386_next_jcc_frag,\n\tadd argument cmp_fragP to return next fusible jcc frag only.\n\t(i386_classify_machine_dependant_frag): Seperate macro-fusible\n\tinstructions from condition jump.\n\t* gas/testsuite/gas/i386/align-branch-9.s: New file.\n\t* gas/testsuite/gas/i386/align-branch-9.d: Ditto.\n\t* gas/testsuite/gas/i386/x86-64-align-branch-9.s: Ditto.\n\t* gas/testsuite/gas/i386/x86-64-align-branch-9.d: Ditto.\n\t* gas/testsuite/gas/i386/i386.exp: Run new tests.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "62b7cfbe6c7556f1a2d66d546893309a94726adf",
      "old_mode": 33188,
      "old_path": "gas/config/tc-i386.c",
      "new_id": "dc745aa7d214eea568e9daaf6641edce31c92296",
      "new_mode": 33188,
      "new_path": "gas/config/tc-i386.c"
    },
    {
      "type": "modify",
      "old_id": "845b3901d4cfd9ec1858187b75ec91c165d20652",
      "old_mode": 33188,
      "old_path": "gas/config/tc-i386.h",
      "new_id": "93678c22822b5baf6a3c55e1a7948d3545b56d91",
      "new_mode": 33188,
      "new_path": "gas/config/tc-i386.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6340817d048eb286bbc4df31dcab44e4400cca94",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/i386/align-branch-9.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "357abe30f97fbe843394cded1a2259954c7a1ee0",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/i386/align-branch-9.s"
    },
    {
      "type": "modify",
      "old_id": "685e62ea729f4157797453d8a946589904f53b19",
      "old_mode": 33188,
      "old_path": "gas/testsuite/gas/i386/i386.exp",
      "new_id": "8fc621f2bbdf71e067d60b6e10f87b17c2471a8c",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/i386/i386.exp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1041fd04833178c4d37760d6e52e654e77cabf21",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/i386/x86-64-align-branch-9.d"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "917579bda401899b1507f998ca122dee6b4a642a",
      "new_mode": 33188,
      "new_path": "gas/testsuite/gas/i386/x86-64-align-branch-9.s"
    }
  ]
}
