Index: llvm/trunk/lib/Target/X86/X86SchedBroadwell.td =================================================================== --- llvm/trunk/lib/Target/X86/X86SchedBroadwell.td +++ llvm/trunk/lib/Target/X86/X86SchedBroadwell.td @@ -1217,7 +1217,7 @@ def: InstRW<[BWWriteResGroup27], (instregex "CVTDQ2PSrr")>; def: InstRW<[BWWriteResGroup27], (instregex "CVTPS2DQrr")>; def: InstRW<[BWWriteResGroup27], (instregex "CVTTPS2DQrr")>; -def: InstRW<[BWWriteResGroup27], (instrs IMUL32rr, IMUL32rri, IMUL32rri8, IMUL64rr, IMUL64rri32, IMUL64rri8)>; +def: InstRW<[BWWriteResGroup27], (instrs IMUL16rr, IMUL32rr, IMUL32rri, IMUL32rri8, IMUL64rr, IMUL64rri32, IMUL64rri8)>; def: InstRW<[BWWriteResGroup27], (instrs IMUL8r)>; def: InstRW<[BWWriteResGroup27], (instregex "LZCNT(16|32|64)rr")>; def: InstRW<[BWWriteResGroup27], (instregex "MAX(C?)PDrr")>; @@ -1298,7 +1298,7 @@ let NumMicroOps = 2; let ResourceCycles = [1,1]; } -def: InstRW<[BWWriteResGroup27_16], (instrs IMUL16rr, IMUL16rri, IMUL16rri8)>; +def: InstRW<[BWWriteResGroup27_16], (instrs IMUL16rri, IMUL16rri8)>; def BWWriteResGroup28 : SchedWriteRes<[BWPort5]> { let Latency = 3; Index: llvm/trunk/lib/Target/X86/X86SchedHaswell.td =================================================================== --- llvm/trunk/lib/Target/X86/X86SchedHaswell.td +++ llvm/trunk/lib/Target/X86/X86SchedHaswell.td @@ -2498,7 +2498,7 @@ def: InstRW<[HWWriteResGroup50], (instregex "CVTDQ2PSrr")>; def: InstRW<[HWWriteResGroup50], (instregex "CVTPS2DQrr")>; def: InstRW<[HWWriteResGroup50], (instregex "CVTTPS2DQrr")>; -def: InstRW<[HWWriteResGroup50], (instrs IMUL64rr, IMUL64rri32, IMUL64rri8)>; +def: InstRW<[HWWriteResGroup50], (instrs IMUL16rr, IMUL32rr, IMUL32rri, IMUL32rri8, IMUL64rr, IMUL64rri32, IMUL64rri8)>; def: InstRW<[HWWriteResGroup50], (instrs IMUL8r)>; def: InstRW<[HWWriteResGroup50], (instregex "LZCNT(16|32|64)rr")>; def: InstRW<[HWWriteResGroup50], (instregex "MAX(C?)PDrr")>; @@ -2574,17 +2574,12 @@ def: InstRW<[HWWriteResGroup50], (instregex "VUCOMISDrr")>; def: InstRW<[HWWriteResGroup50], (instregex "VUCOMISSrr")>; -def HWWriteResGroup50_16 : SchedWriteRes<[HWPort1, HWPort0156]> { +def HWWriteResGroup50_16i : SchedWriteRes<[HWPort1, HWPort0156]> { let Latency = 3; - let NumMicroOps = 4; -} -def: InstRW<[HWWriteResGroup50_16], (instrs IMUL16rr, IMUL16rri, IMUL16rri8)>; - -def HWWriteResGroup50_32 : SchedWriteRes<[HWPort1, HWPort0156]> { - let Latency = 3; - let NumMicroOps = 3; + let NumMicroOps = 2; + let ResourceCycles = [1,1]; } -def: InstRW<[HWWriteResGroup50_32], (instrs IMUL32rr, IMUL32rri, IMUL32rri8)>; +def: InstRW<[HWWriteResGroup50_16i], (instrs IMUL16rri, IMUL16rri8)>; def HWWriteResGroup51 : SchedWriteRes<[HWPort5]> { let Latency = 3; Index: llvm/trunk/lib/Target/X86/X86SchedSandyBridge.td =================================================================== --- llvm/trunk/lib/Target/X86/X86SchedSandyBridge.td +++ llvm/trunk/lib/Target/X86/X86SchedSandyBridge.td @@ -925,6 +925,7 @@ def: InstRW<[SBWriteResGroup21], (instregex "CVTDQ2PSrr")>; def: InstRW<[SBWriteResGroup21], (instregex "CVTPS2DQrr")>; def: InstRW<[SBWriteResGroup21], (instregex "CVTTPS2DQrr")>; +def: InstRW<[SBWriteResGroup21], (instrs IMUL16rr, IMUL32rr, IMUL32rri, IMUL32rri8, IMUL64rr, IMUL64rri32, IMUL64rri8)>; def: InstRW<[SBWriteResGroup21], (instregex "MAX(C?)PDrr")>; def: InstRW<[SBWriteResGroup21], (instregex "MAX(C?)PSrr")>; def: InstRW<[SBWriteResGroup21], (instregex "MAX(C?)SDrr")>; @@ -1000,6 +1001,13 @@ def: InstRW<[SBWriteResGroup21], (instregex "VSUBSDrr")>; def: InstRW<[SBWriteResGroup21], (instregex "VSUBSSrr")>; +def SBWriteResGroup21_16i : SchedWriteRes<[SBPort1, SBPort015]> { + let Latency = 3; + let NumMicroOps = 2; + let ResourceCycles = [1,1]; +} +def: InstRW<[SBWriteResGroup21_16i], (instrs IMUL16rri, IMUL16rri8)>; + def SBWriteResGroup22 : SchedWriteRes<[SBPort0,SBPort5]> { let Latency = 3; let NumMicroOps = 2; Index: llvm/trunk/lib/Target/X86/X86SchedSkylakeClient.td =================================================================== --- llvm/trunk/lib/Target/X86/X86SchedSkylakeClient.td +++ llvm/trunk/lib/Target/X86/X86SchedSkylakeClient.td @@ -1214,7 +1214,7 @@ } def: InstRW<[SKLWriteResGroup29], (instregex "BSF(16|32|64)rr")>; def: InstRW<[SKLWriteResGroup29], (instregex "BSR(16|32|64)rr")>; -def: InstRW<[SKLWriteResGroup29], (instrs IMUL64rr, IMUL64rri32, IMUL64rri8)>; +def: InstRW<[SKLWriteResGroup29], (instrs IMUL16rr, IMUL32rr, IMUL32rri, IMUL32rri8, IMUL64rr, IMUL64rri32, IMUL64rri8)>; def: InstRW<[SKLWriteResGroup29], (instrs IMUL8r)>; def: InstRW<[SKLWriteResGroup29], (instregex "LZCNT(16|32|64)rr")>; def: InstRW<[SKLWriteResGroup29], (instrs MUL8r)>; @@ -1225,18 +1225,12 @@ def: InstRW<[SKLWriteResGroup29], (instregex "SHRD(16|32|64)rri8")>; def: InstRW<[SKLWriteResGroup29], (instregex "TZCNT(16|32|64)rr")>; -def SKLWriteResGroup29_16 : SchedWriteRes<[SKLPort1, SKLPort0156]> { +def SKLWriteResGroup29_16i : SchedWriteRes<[SKLPort1, SKLPort0156]> { let Latency = 3; let NumMicroOps = 2; let ResourceCycles = [1,1]; } -def: InstRW<[SKLWriteResGroup29_16], (instrs IMUL16rr, IMUL16rri, IMUL16rri8)>; - -def SKLWriteResGroup29_32 : SchedWriteRes<[SKLPort1]> { - let Latency = 3; - let NumMicroOps = 1; -} -def: InstRW<[SKLWriteResGroup29_32], (instrs IMUL32rr, IMUL32rri, IMUL32rri8)>; +def: InstRW<[SKLWriteResGroup29_16i], (instrs IMUL16rri, IMUL16rri8)>; def SKLWriteResGroup30 : SchedWriteRes<[SKLPort5]> { let Latency = 3; Index: llvm/trunk/lib/Target/X86/X86SchedSkylakeServer.td =================================================================== --- llvm/trunk/lib/Target/X86/X86SchedSkylakeServer.td +++ llvm/trunk/lib/Target/X86/X86SchedSkylakeServer.td @@ -1758,7 +1758,7 @@ } def: InstRW<[SKXWriteResGroup31], (instregex "BSF(16|32|64)rr")>; def: InstRW<[SKXWriteResGroup31], (instregex "BSR(16|32|64)rr")>; -def: InstRW<[SKXWriteResGroup31], (instrs IMUL64rr, IMUL64rri32, IMUL64rri8)>; +def: InstRW<[SKXWriteResGroup31], (instrs IMUL16rr, IMUL32rr, IMUL32rri, IMUL32rri8, IMUL64rr, IMUL64rri32, IMUL64rri8)>; def: InstRW<[SKXWriteResGroup31], (instrs IMUL8r)>; def: InstRW<[SKXWriteResGroup31], (instregex "LZCNT(16|32|64)rr")>; def: InstRW<[SKXWriteResGroup31], (instrs MUL8r)>; @@ -1769,18 +1769,13 @@ def: InstRW<[SKXWriteResGroup31], (instregex "SHRD(16|32|64)rri8")>; def: InstRW<[SKXWriteResGroup31], (instregex "TZCNT(16|32|64)rr")>; -def SKXWriteResGroup31_16 : SchedWriteRes<[SKXPort1, SKXPort0156]> { +def SKXWriteResGroup31_16i : SchedWriteRes<[SKXPort1, SKXPort0156]> { let Latency = 3; let NumMicroOps = 2; let ResourceCycles = [1,1]; } -def: InstRW<[SKXWriteResGroup31_16], (instrs IMUL16rr, IMUL16rri, IMUL16rri8)>; +def: InstRW<[SKXWriteResGroup31_16i], (instrs IMUL16rri, IMUL16rri8)>; -def SKXWriteResGroup31_32 : SchedWriteRes<[SKXPort1]> { - let Latency = 3; - let NumMicroOps = 1; -} -def: InstRW<[SKXWriteResGroup31_32], (instrs IMUL32rr, IMUL32rri, IMUL32rri8)>; def SKXWriteResGroup32 : SchedWriteRes<[SKXPort5]> { let Latency = 3;