1//=- X86SchedSkylake.td - X86 Skylake Client Scheduling ------*- tablegen -*-=// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8// 9// This file defines the machine model for Skylake Client to support 10// instruction scheduling and other instruction cost heuristics. 11// 12//===----------------------------------------------------------------------===// 13 14def SkylakeClientModel : SchedMachineModel { 15 // All x86 instructions are modeled as a single micro-op, and SKylake can 16 // decode 6 instructions per cycle. 17 let IssueWidth = 6; 18 let MicroOpBufferSize = 224; // Based on the reorder buffer. 19 let LoadLatency = 5; 20 let MispredictPenalty = 14; 21 22 // Based on the LSD (loop-stream detector) queue size and benchmarking data. 23 let LoopMicroOpBufferSize = 50; 24 25 // This flag is set to allow the scheduler to assign a default model to 26 // unrecognized opcodes. 27 let CompleteModel = 0; 28} 29 30let SchedModel = SkylakeClientModel in { 31 32// Skylake Client can issue micro-ops to 8 different ports in one cycle. 33 34// Ports 0, 1, 5, and 6 handle all computation. 35// Port 4 gets the data half of stores. Store data can be available later than 36// the store address, but since we don't model the latency of stores, we can 37// ignore that. 38// Ports 2 and 3 are identical. They handle loads and the address half of 39// stores. Port 7 can handle address calculations. 40def SKLPort0 : ProcResource<1>; 41def SKLPort1 : ProcResource<1>; 42def SKLPort2 : ProcResource<1>; 43def SKLPort3 : ProcResource<1>; 44def SKLPort4 : ProcResource<1>; 45def SKLPort5 : ProcResource<1>; 46def SKLPort6 : ProcResource<1>; 47def SKLPort7 : ProcResource<1>; 48 49// Many micro-ops are capable of issuing on multiple ports. 50def SKLPort01 : ProcResGroup<[SKLPort0, SKLPort1]>; 51def SKLPort23 : ProcResGroup<[SKLPort2, SKLPort3]>; 52def SKLPort237 : ProcResGroup<[SKLPort2, SKLPort3, SKLPort7]>; 53def SKLPort04 : ProcResGroup<[SKLPort0, SKLPort4]>; 54def SKLPort05 : ProcResGroup<[SKLPort0, SKLPort5]>; 55def SKLPort06 : ProcResGroup<[SKLPort0, SKLPort6]>; 56def SKLPort15 : ProcResGroup<[SKLPort1, SKLPort5]>; 57def SKLPort16 : ProcResGroup<[SKLPort1, SKLPort6]>; 58def SKLPort56 : ProcResGroup<[SKLPort5, SKLPort6]>; 59def SKLPort015 : ProcResGroup<[SKLPort0, SKLPort1, SKLPort5]>; 60def SKLPort056 : ProcResGroup<[SKLPort0, SKLPort5, SKLPort6]>; 61def SKLPort0156: ProcResGroup<[SKLPort0, SKLPort1, SKLPort5, SKLPort6]>; 62 63def SKLDivider : ProcResource<1>; // Integer division issued on port 0. 64// FP division and sqrt on port 0. 65def SKLFPDivider : ProcResource<1>; 66 67// 60 Entry Unified Scheduler 68def SKLPortAny : ProcResGroup<[SKLPort0, SKLPort1, SKLPort2, SKLPort3, SKLPort4, 69 SKLPort5, SKLPort6, SKLPort7]> { 70 let BufferSize=60; 71} 72 73// Integer loads are 5 cycles, so ReadAfterLd registers needn't be available until 5 74// cycles after the memory operand. 75def : ReadAdvance<ReadAfterLd, 5>; 76 77// Vector loads are 5/6/7 cycles, so ReadAfterVec*Ld registers needn't be available 78// until 5/6/7 cycles after the memory operand. 79def : ReadAdvance<ReadAfterVecLd, 5>; 80def : ReadAdvance<ReadAfterVecXLd, 6>; 81def : ReadAdvance<ReadAfterVecYLd, 7>; 82 83def : ReadAdvance<ReadInt2Fpu, 0>; 84 85// Many SchedWrites are defined in pairs with and without a folded load. 86// Instructions with folded loads are usually micro-fused, so they only appear 87// as two micro-ops when queued in the reservation station. 88// This multiclass defines the resource usage for variants with and without 89// folded loads. 90multiclass SKLWriteResPair<X86FoldableSchedWrite SchedRW, 91 list<ProcResourceKind> ExePorts, 92 int Lat, list<int> Res = [1], int UOps = 1, 93 int LoadLat = 5> { 94 // Register variant is using a single cycle on ExePort. 95 def : WriteRes<SchedRW, ExePorts> { 96 let Latency = Lat; 97 let ResourceCycles = Res; 98 let NumMicroOps = UOps; 99 } 100 101 // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to 102 // the latency (default = 5). 103 def : WriteRes<SchedRW.Folded, !listconcat([SKLPort23], ExePorts)> { 104 let Latency = !add(Lat, LoadLat); 105 let ResourceCycles = !listconcat([1], Res); 106 let NumMicroOps = !add(UOps, 1); 107 } 108} 109 110// A folded store needs a cycle on port 4 for the store data, and an extra port 111// 2/3/7 cycle to recompute the address. 112def : WriteRes<WriteRMW, [SKLPort237,SKLPort4]>; 113 114// Arithmetic. 115defm : SKLWriteResPair<WriteALU, [SKLPort0156], 1>; // Simple integer ALU op. 116defm : SKLWriteResPair<WriteADC, [SKLPort06], 1>; // Integer ALU + flags op. 117 118// Integer multiplication. 119defm : SKLWriteResPair<WriteIMul8, [SKLPort1], 3>; 120defm : SKLWriteResPair<WriteIMul16, [SKLPort1,SKLPort06,SKLPort0156], 4, [1,1,2], 4>; 121defm : X86WriteRes<WriteIMul16Imm, [SKLPort1,SKLPort0156], 4, [1,1], 2>; 122defm : X86WriteRes<WriteIMul16ImmLd, [SKLPort1,SKLPort0156,SKLPort23], 8, [1,1,1], 3>; 123defm : SKLWriteResPair<WriteIMul16Reg, [SKLPort1], 3>; 124defm : SKLWriteResPair<WriteIMul32, [SKLPort1,SKLPort06,SKLPort0156], 4, [1,1,1], 3>; 125defm : SKLWriteResPair<WriteMULX32, [SKLPort1,SKLPort06,SKLPort0156], 3, [1,1,1], 3>; 126defm : SKLWriteResPair<WriteIMul32Imm, [SKLPort1], 3>; 127defm : SKLWriteResPair<WriteIMul32Reg, [SKLPort1], 3>; 128defm : SKLWriteResPair<WriteIMul64, [SKLPort1,SKLPort5], 4, [1,1], 2>; 129defm : SKLWriteResPair<WriteMULX64, [SKLPort1,SKLPort5], 3, [1,1], 2>; 130defm : SKLWriteResPair<WriteIMul64Imm, [SKLPort1], 3>; 131defm : SKLWriteResPair<WriteIMul64Reg, [SKLPort1], 3>; 132def SKLWriteIMulH : WriteRes<WriteIMulH, []> { let Latency = 4; } 133def : WriteRes<WriteIMulHLd, []> { 134 let Latency = !add(SKLWriteIMulH.Latency, SkylakeClientModel.LoadLatency); 135} 136 137defm : X86WriteRes<WriteBSWAP32, [SKLPort15], 1, [1], 1>; 138defm : X86WriteRes<WriteBSWAP64, [SKLPort06, SKLPort15], 2, [1,1], 2>; 139defm : X86WriteRes<WriteCMPXCHG,[SKLPort06, SKLPort0156], 5, [2,3], 5>; 140defm : X86WriteRes<WriteCMPXCHGRMW,[SKLPort23,SKLPort06,SKLPort0156,SKLPort237,SKLPort4], 8, [1,2,1,1,1], 6>; 141defm : X86WriteRes<WriteXCHG, [SKLPort0156], 2, [3], 3>; 142 143// TODO: Why isn't the SKLDivider used? 144defm : SKLWriteResPair<WriteDiv8, [SKLPort0,SKLDivider], 25, [1,10], 1, 4>; 145defm : X86WriteRes<WriteDiv16, [SKLPort0,SKLPort1,SKLPort5,SKLPort6,SKLPort05,SKLPort0156], 76, [7,2,8,3,1,11], 32>; 146defm : X86WriteRes<WriteDiv32, [SKLPort0,SKLPort1,SKLPort5,SKLPort6,SKLPort05,SKLPort0156], 76, [7,2,8,3,1,11], 32>; 147defm : X86WriteRes<WriteDiv64, [SKLPort0,SKLPort1,SKLPort5,SKLPort6,SKLPort05,SKLPort0156], 76, [7,2,8,3,1,11], 32>; 148defm : X86WriteRes<WriteDiv16Ld, [SKLPort0,SKLPort23,SKLDivider], 29, [1,1,10], 2>; 149defm : X86WriteRes<WriteDiv32Ld, [SKLPort0,SKLPort23,SKLDivider], 29, [1,1,10], 2>; 150defm : X86WriteRes<WriteDiv64Ld, [SKLPort0,SKLPort23,SKLDivider], 29, [1,1,10], 2>; 151 152defm : X86WriteRes<WriteIDiv8, [SKLPort0,SKLDivider], 25, [1,10], 1>; 153defm : X86WriteRes<WriteIDiv16, [SKLPort0,SKLPort1,SKLPort5,SKLPort6,SKLPort06,SKLPort0156], 102, [4,2,4,8,14,34], 66>; 154defm : X86WriteRes<WriteIDiv32, [SKLPort0,SKLPort1,SKLPort5,SKLPort6,SKLPort06,SKLPort0156], 102, [4,2,4,8,14,34], 66>; 155defm : X86WriteRes<WriteIDiv64, [SKLPort0,SKLPort1,SKLPort5,SKLPort6,SKLPort06,SKLPort0156], 102, [4,2,4,8,14,34], 66>; 156defm : X86WriteRes<WriteIDiv8Ld, [SKLPort0,SKLPort5,SKLPort23,SKLPort0156], 28, [2,4,1,1], 8>; 157defm : X86WriteRes<WriteIDiv16Ld, [SKLPort0,SKLPort5,SKLPort23,SKLPort0156], 28, [2,4,1,1], 8>; 158defm : X86WriteRes<WriteIDiv32Ld, [SKLPort0,SKLPort5,SKLPort23,SKLPort0156], 28, [2,4,1,1], 8>; 159defm : X86WriteRes<WriteIDiv64Ld, [SKLPort0,SKLPort5,SKLPort23,SKLPort0156], 28, [2,4,1,1], 8>; 160 161defm : SKLWriteResPair<WriteCRC32, [SKLPort1], 3>; 162 163def : WriteRes<WriteLEA, [SKLPort15]>; // LEA instructions can't fold loads. 164 165defm : SKLWriteResPair<WriteCMOV, [SKLPort06], 1, [1], 1>; // Conditional move. 166defm : X86WriteRes<WriteFCMOV, [SKLPort1], 3, [1], 1>; // x87 conditional move. 167def : WriteRes<WriteSETCC, [SKLPort06]>; // Setcc. 168def : WriteRes<WriteSETCCStore, [SKLPort06,SKLPort4,SKLPort237]> { 169 let Latency = 2; 170 let NumMicroOps = 3; 171} 172 173defm : X86WriteRes<WriteLAHFSAHF, [SKLPort06], 1, [1], 1>; 174defm : X86WriteRes<WriteBitTest, [SKLPort06], 1, [1], 1>; 175defm : X86WriteRes<WriteBitTestImmLd, [SKLPort06,SKLPort23], 6, [1,1], 2>; 176defm : X86WriteRes<WriteBitTestRegLd, [SKLPort0156,SKLPort23], 6, [1,1], 2>; 177defm : X86WriteRes<WriteBitTestSet, [SKLPort06], 1, [1], 1>; 178defm : X86WriteRes<WriteBitTestSetImmLd, [SKLPort06,SKLPort23], 5, [1,1], 3>; 179defm : X86WriteRes<WriteBitTestSetRegLd, [SKLPort0156,SKLPort23], 5, [1,1], 2>; 180 181// Bit counts. 182defm : SKLWriteResPair<WriteBSF, [SKLPort1], 3>; 183defm : SKLWriteResPair<WriteBSR, [SKLPort1], 3>; 184defm : SKLWriteResPair<WriteLZCNT, [SKLPort1], 3>; 185defm : SKLWriteResPair<WriteTZCNT, [SKLPort1], 3>; 186defm : SKLWriteResPair<WritePOPCNT, [SKLPort1], 3>; 187 188// Integer shifts and rotates. 189defm : SKLWriteResPair<WriteShift, [SKLPort06], 1>; 190defm : SKLWriteResPair<WriteShiftCL, [SKLPort06], 3, [3], 3>; 191defm : SKLWriteResPair<WriteRotate, [SKLPort06], 1, [1], 1>; 192defm : SKLWriteResPair<WriteRotateCL, [SKLPort06], 3, [3], 3>; 193 194// SHLD/SHRD. 195defm : X86WriteRes<WriteSHDrri, [SKLPort1], 3, [1], 1>; 196defm : X86WriteRes<WriteSHDrrcl,[SKLPort1,SKLPort06,SKLPort0156], 6, [1, 2, 1], 4>; 197defm : X86WriteRes<WriteSHDmri, [SKLPort1,SKLPort23,SKLPort237,SKLPort0156], 9, [1, 1, 1, 1], 4>; 198defm : X86WriteRes<WriteSHDmrcl,[SKLPort1,SKLPort23,SKLPort237,SKLPort06,SKLPort0156], 11, [1, 1, 1, 2, 1], 6>; 199 200// BMI1 BEXTR/BLS, BMI2 BZHI 201defm : SKLWriteResPair<WriteBEXTR, [SKLPort06,SKLPort15], 2, [1,1], 2>; 202defm : SKLWriteResPair<WriteBLS, [SKLPort15], 1>; 203defm : SKLWriteResPair<WriteBZHI, [SKLPort15], 1>; 204 205// Loads, stores, and moves, not folded with other operations. 206defm : X86WriteRes<WriteLoad, [SKLPort23], 5, [1], 1>; 207defm : X86WriteRes<WriteStore, [SKLPort237, SKLPort4], 1, [1,1], 1>; 208defm : X86WriteRes<WriteStoreNT, [SKLPort237, SKLPort4], 1, [1,1], 2>; 209defm : X86WriteRes<WriteMove, [SKLPort0156], 1, [1], 1>; 210 211// Model the effect of clobbering the read-write mask operand of the GATHER operation. 212// Does not cost anything by itself, only has latency, matching that of the WriteLoad, 213defm : X86WriteRes<WriteVecMaskedGatherWriteback, [], 5, [], 0>; 214 215// Idioms that clear a register, like xorps %xmm0, %xmm0. 216// These can often bypass execution ports completely. 217def : WriteRes<WriteZero, []>; 218 219// Branches don't produce values, so they have no latency, but they still 220// consume resources. Indirect branches can fold loads. 221defm : SKLWriteResPair<WriteJump, [SKLPort06], 1>; 222 223// Floating point. This covers both scalar and vector operations. 224defm : X86WriteRes<WriteFLD0, [SKLPort05], 1, [1], 1>; 225defm : X86WriteRes<WriteFLD1, [SKLPort05], 1, [2], 2>; 226defm : X86WriteRes<WriteFLDC, [SKLPort05], 1, [2], 2>; 227defm : X86WriteRes<WriteFLoad, [SKLPort23], 5, [1], 1>; 228defm : X86WriteRes<WriteFLoadX, [SKLPort23], 6, [1], 1>; 229defm : X86WriteRes<WriteFLoadY, [SKLPort23], 7, [1], 1>; 230defm : X86WriteRes<WriteFMaskedLoad, [SKLPort23,SKLPort015], 7, [1,1], 2>; 231defm : X86WriteRes<WriteFMaskedLoadY, [SKLPort23,SKLPort015], 8, [1,1], 2>; 232defm : X86WriteRes<WriteFStore, [SKLPort237,SKLPort4], 1, [1,1], 2>; 233defm : X86WriteRes<WriteFStoreX, [SKLPort237,SKLPort4], 1, [1,1], 2>; 234defm : X86WriteRes<WriteFStoreY, [SKLPort237,SKLPort4], 1, [1,1], 2>; 235defm : X86WriteRes<WriteFStoreNT, [SKLPort237,SKLPort4], 1, [1,1], 2>; 236defm : X86WriteRes<WriteFStoreNTX, [SKLPort237,SKLPort4], 1, [1,1], 2>; 237defm : X86WriteRes<WriteFStoreNTY, [SKLPort237,SKLPort4], 1, [1,1], 2>; 238 239defm : X86WriteRes<WriteFMaskedStore32, [SKLPort237,SKLPort0], 2, [1,1], 2>; 240defm : X86WriteRes<WriteFMaskedStore32Y, [SKLPort237,SKLPort0], 2, [1,1], 2>; 241defm : X86WriteRes<WriteFMaskedStore64, [SKLPort237,SKLPort0], 2, [1,1], 2>; 242defm : X86WriteRes<WriteFMaskedStore64Y, [SKLPort237,SKLPort0], 2, [1,1], 2>; 243 244defm : X86WriteRes<WriteFMove, [SKLPort015], 1, [1], 1>; 245defm : X86WriteRes<WriteFMoveX, [SKLPort015], 1, [1], 1>; 246defm : X86WriteRes<WriteFMoveY, [SKLPort015], 1, [1], 1>; 247defm : X86WriteResUnsupported<WriteFMoveZ>; 248defm : X86WriteRes<WriteEMMS, [SKLPort05,SKLPort0156], 10, [9,1], 10>; 249 250defm : SKLWriteResPair<WriteFAdd, [SKLPort01], 4, [1], 1, 5>; // Floating point add/sub. 251defm : SKLWriteResPair<WriteFAddX, [SKLPort01], 4, [1], 1, 6>; 252defm : SKLWriteResPair<WriteFAddY, [SKLPort01], 4, [1], 1, 7>; 253defm : X86WriteResPairUnsupported<WriteFAddZ>; 254defm : SKLWriteResPair<WriteFAdd64, [SKLPort01], 4, [1], 1, 5>; // Floating point double add/sub. 255defm : SKLWriteResPair<WriteFAdd64X, [SKLPort01], 4, [1], 1, 6>; 256defm : SKLWriteResPair<WriteFAdd64Y, [SKLPort01], 4, [1], 1, 7>; 257defm : X86WriteResPairUnsupported<WriteFAdd64Z>; 258 259defm : SKLWriteResPair<WriteFCmp, [SKLPort01], 4, [1], 1, 5>; // Floating point compare. 260defm : SKLWriteResPair<WriteFCmpX, [SKLPort01], 4, [1], 1, 6>; 261defm : SKLWriteResPair<WriteFCmpY, [SKLPort01], 4, [1], 1, 7>; 262defm : X86WriteResPairUnsupported<WriteFCmpZ>; 263defm : SKLWriteResPair<WriteFCmp64, [SKLPort01], 4, [1], 1, 5>; // Floating point double compare. 264defm : SKLWriteResPair<WriteFCmp64X, [SKLPort01], 4, [1], 1, 6>; 265defm : SKLWriteResPair<WriteFCmp64Y, [SKLPort01], 4, [1], 1, 7>; 266defm : X86WriteResPairUnsupported<WriteFCmp64Z>; 267 268defm : SKLWriteResPair<WriteFCom, [SKLPort0], 2>; // Floating point compare to flags (X87). 269defm : SKLWriteResPair<WriteFComX, [SKLPort0], 2>; // Floating point compare to flags (SSE). 270 271defm : SKLWriteResPair<WriteFMul, [SKLPort01], 4, [1], 1, 5>; // Floating point multiplication. 272defm : SKLWriteResPair<WriteFMulX, [SKLPort01], 4, [1], 1, 6>; 273defm : SKLWriteResPair<WriteFMulY, [SKLPort01], 4, [1], 1, 7>; 274defm : X86WriteResPairUnsupported<WriteFMulZ>; 275defm : SKLWriteResPair<WriteFMul64, [SKLPort01], 4, [1], 1, 5>; // Floating point double multiplication. 276defm : SKLWriteResPair<WriteFMul64X, [SKLPort01], 4, [1], 1, 6>; 277defm : SKLWriteResPair<WriteFMul64Y, [SKLPort01], 4, [1], 1, 7>; 278defm : X86WriteResPairUnsupported<WriteFMul64Z>; 279 280defm : SKLWriteResPair<WriteFDiv, [SKLPort0,SKLFPDivider], 11, [1,3], 1, 5>; // Floating point division. 281//defm : SKLWriteResPair<WriteFDivX, [SKLPort0,SKLFPDivider], 11, [1,3], 1, 6>; 282defm : SKLWriteResPair<WriteFDivY, [SKLPort0,SKLFPDivider], 11, [1,5], 1, 7>; 283defm : X86WriteResPairUnsupported<WriteFDivZ>; 284//defm : SKLWriteResPair<WriteFDiv64, [SKLPort0,SKLFPDivider], 14, [1,3], 1, 5>; // Floating point double division. 285//defm : SKLWriteResPair<WriteFDiv64X, [SKLPort0,SKLFPDivider], 14, [1,3], 1, 6>; 286//defm : SKLWriteResPair<WriteFDiv64Y, [SKLPort0,SKLFPDivider], 14, [1,5], 1, 7>; 287defm : X86WriteResPairUnsupported<WriteFDiv64Z>; 288 289defm : SKLWriteResPair<WriteFSqrt, [SKLPort0,SKLFPDivider], 12, [1,3], 1, 5>; // Floating point square root. 290defm : SKLWriteResPair<WriteFSqrtX, [SKLPort0,SKLFPDivider], 12, [1,3], 1, 6>; 291defm : SKLWriteResPair<WriteFSqrtY, [SKLPort0,SKLFPDivider], 12, [1,6], 1, 7>; 292defm : X86WriteResPairUnsupported<WriteFSqrtZ>; 293defm : SKLWriteResPair<WriteFSqrt64, [SKLPort0,SKLFPDivider], 18, [1,6], 1, 5>; // Floating point double square root. 294defm : SKLWriteResPair<WriteFSqrt64X, [SKLPort0,SKLFPDivider], 18, [1,6], 1, 6>; 295defm : SKLWriteResPair<WriteFSqrt64Y, [SKLPort0,SKLFPDivider], 18, [1,12],1, 7>; 296defm : X86WriteResPairUnsupported<WriteFSqrt64Z>; 297defm : SKLWriteResPair<WriteFSqrt80, [SKLPort0,SKLFPDivider], 21, [1,7]>; // Floating point long double square root. 298 299defm : SKLWriteResPair<WriteFRcp, [SKLPort0], 4, [1], 1, 5>; // Floating point reciprocal estimate. 300defm : SKLWriteResPair<WriteFRcpX, [SKLPort0], 4, [1], 1, 6>; 301defm : SKLWriteResPair<WriteFRcpY, [SKLPort0], 4, [1], 1, 7>; 302defm : X86WriteResPairUnsupported<WriteFRcpZ>; 303 304defm : SKLWriteResPair<WriteFRsqrt, [SKLPort0], 4, [1], 1, 5>; // Floating point reciprocal square root estimate. 305defm : SKLWriteResPair<WriteFRsqrtX,[SKLPort0], 4, [1], 1, 6>; 306defm : SKLWriteResPair<WriteFRsqrtY,[SKLPort0], 4, [1], 1, 7>; 307defm : X86WriteResPairUnsupported<WriteFRsqrtZ>; 308 309defm : SKLWriteResPair<WriteFMA, [SKLPort01], 4, [1], 1, 5>; // Fused Multiply Add. 310defm : SKLWriteResPair<WriteFMAX, [SKLPort01], 4, [1], 1, 6>; 311defm : SKLWriteResPair<WriteFMAY, [SKLPort01], 4, [1], 1, 7>; 312defm : X86WriteResPairUnsupported<WriteFMAZ>; 313defm : SKLWriteResPair<WriteDPPD, [SKLPort5,SKLPort01], 9, [1,2], 3, 6>; // Floating point double dot product. 314defm : SKLWriteResPair<WriteDPPS, [SKLPort5,SKLPort01], 13, [1,3], 4, 6>; 315defm : SKLWriteResPair<WriteDPPSY, [SKLPort5,SKLPort01], 13, [1,3], 4, 7>; 316defm : X86WriteResPairUnsupported<WriteDPPSZ>; 317defm : SKLWriteResPair<WriteFSign, [SKLPort0], 1>; // Floating point fabs/fchs. 318defm : SKLWriteResPair<WriteFRnd, [SKLPort01], 8, [2], 2, 6>; // Floating point rounding. 319defm : SKLWriteResPair<WriteFRndY, [SKLPort01], 8, [2], 2, 7>; 320defm : X86WriteResPairUnsupported<WriteFRndZ>; 321defm : SKLWriteResPair<WriteFLogic, [SKLPort015], 1, [1], 1, 6>; // Floating point and/or/xor logicals. 322defm : SKLWriteResPair<WriteFLogicY, [SKLPort015], 1, [1], 1, 7>; 323defm : X86WriteResPairUnsupported<WriteFLogicZ>; 324defm : SKLWriteResPair<WriteFTest, [SKLPort0], 2, [1], 1, 6>; // Floating point TEST instructions. 325defm : SKLWriteResPair<WriteFTestY, [SKLPort0], 2, [1], 1, 7>; 326defm : X86WriteResPairUnsupported<WriteFTestZ>; 327defm : SKLWriteResPair<WriteFShuffle, [SKLPort5], 1, [1], 1, 6>; // Floating point vector shuffles. 328defm : SKLWriteResPair<WriteFShuffleY, [SKLPort5], 1, [1], 1, 7>; 329defm : X86WriteResPairUnsupported<WriteFShuffleZ>; 330defm : SKLWriteResPair<WriteFVarShuffle, [SKLPort5], 1, [1], 1, 6>; // Floating point vector shuffles. 331defm : SKLWriteResPair<WriteFVarShuffleY, [SKLPort5], 1, [1], 1, 7>; 332defm : X86WriteResPairUnsupported<WriteFVarShuffleZ>; 333defm : SKLWriteResPair<WriteFBlend, [SKLPort015], 1, [1], 1, 6>; // Floating point vector blends. 334defm : SKLWriteResPair<WriteFBlendY, [SKLPort015], 1, [1], 1, 7>; 335defm : X86WriteResPairUnsupported<WriteFBlendZ>; 336defm : SKLWriteResPair<WriteFVarBlend, [SKLPort015], 2, [2], 2, 6>; // Fp vector variable blends. 337defm : SKLWriteResPair<WriteFVarBlendY,[SKLPort015], 2, [2], 2, 7>; 338defm : X86WriteResPairUnsupported<WriteFVarBlendZ>; 339 340// FMA Scheduling helper class. 341// class FMASC { X86FoldableSchedWrite Sched = WriteFAdd; } 342 343// Vector integer operations. 344defm : X86WriteRes<WriteVecLoad, [SKLPort23], 5, [1], 1>; 345defm : X86WriteRes<WriteVecLoadX, [SKLPort23], 6, [1], 1>; 346defm : X86WriteRes<WriteVecLoadY, [SKLPort23], 7, [1], 1>; 347defm : X86WriteRes<WriteVecLoadNT, [SKLPort23], 6, [1], 1>; 348defm : X86WriteRes<WriteVecLoadNTY, [SKLPort23], 7, [1], 1>; 349defm : X86WriteRes<WriteVecMaskedLoad, [SKLPort23,SKLPort015], 7, [1,1], 2>; 350defm : X86WriteRes<WriteVecMaskedLoadY, [SKLPort23,SKLPort015], 8, [1,1], 2>; 351defm : X86WriteRes<WriteVecStore, [SKLPort237,SKLPort4], 1, [1,1], 2>; 352defm : X86WriteRes<WriteVecStoreX, [SKLPort237,SKLPort4], 1, [1,1], 2>; 353defm : X86WriteRes<WriteVecStoreY, [SKLPort237,SKLPort4], 1, [1,1], 2>; 354defm : X86WriteRes<WriteVecStoreNT, [SKLPort237,SKLPort4], 1, [1,1], 2>; 355defm : X86WriteRes<WriteVecStoreNTY, [SKLPort237,SKLPort4], 1, [1,1], 2>; 356defm : X86WriteRes<WriteVecMaskedStore32, [SKLPort237,SKLPort0], 2, [1,1], 2>; 357defm : X86WriteRes<WriteVecMaskedStore32Y, [SKLPort237,SKLPort0], 2, [1,1], 2>; 358defm : X86WriteRes<WriteVecMaskedStore64, [SKLPort237,SKLPort0], 2, [1,1], 2>; 359defm : X86WriteRes<WriteVecMaskedStore64Y, [SKLPort237,SKLPort0], 2, [1,1], 2>; 360defm : X86WriteRes<WriteVecMove, [SKLPort05], 1, [1], 1>; 361defm : X86WriteRes<WriteVecMoveX, [SKLPort015], 1, [1], 1>; 362defm : X86WriteRes<WriteVecMoveY, [SKLPort015], 1, [1], 1>; 363defm : X86WriteResUnsupported<WriteVecMoveZ>; 364defm : X86WriteRes<WriteVecMoveToGpr, [SKLPort0], 2, [1], 1>; 365defm : X86WriteRes<WriteVecMoveFromGpr, [SKLPort5], 1, [1], 1>; 366 367defm : SKLWriteResPair<WriteVecALU, [SKLPort05], 1, [1], 1, 5>; // Vector integer ALU op, no logicals. 368defm : SKLWriteResPair<WriteVecALUX, [SKLPort01], 1, [1], 1, 6>; 369defm : SKLWriteResPair<WriteVecALUY, [SKLPort01], 1, [1], 1, 7>; 370defm : X86WriteResPairUnsupported<WriteVecALUZ>; 371defm : SKLWriteResPair<WriteVecLogic, [SKLPort05], 1, [1], 1, 5>; // Vector integer and/or/xor. 372defm : SKLWriteResPair<WriteVecLogicX,[SKLPort015], 1, [1], 1, 6>; 373defm : SKLWriteResPair<WriteVecLogicY,[SKLPort015], 1, [1], 1, 7>; 374defm : X86WriteResPairUnsupported<WriteVecLogicZ>; 375defm : SKLWriteResPair<WriteVecTest, [SKLPort0,SKLPort5], 3, [1,1], 2, 6>; // Vector integer TEST instructions. 376defm : SKLWriteResPair<WriteVecTestY, [SKLPort0,SKLPort5], 3, [1,1], 2, 7>; 377defm : X86WriteResPairUnsupported<WriteVecTestZ>; 378defm : SKLWriteResPair<WriteVecIMul, [SKLPort0] , 5, [1], 1, 5>; // Vector integer multiply. 379defm : SKLWriteResPair<WriteVecIMulX, [SKLPort01], 5, [1], 1, 6>; 380defm : SKLWriteResPair<WriteVecIMulY, [SKLPort01], 5, [1], 1, 7>; 381defm : X86WriteResPairUnsupported<WriteVecIMulZ>; 382defm : SKLWriteResPair<WritePMULLD, [SKLPort01], 10, [2], 2, 6>; // Vector PMULLD. 383defm : SKLWriteResPair<WritePMULLDY, [SKLPort01], 10, [2], 2, 7>; 384defm : X86WriteResPairUnsupported<WritePMULLDZ>; 385defm : SKLWriteResPair<WriteShuffle, [SKLPort5], 1, [1], 1, 5>; // Vector shuffles. 386defm : SKLWriteResPair<WriteShuffleX, [SKLPort5], 1, [1], 1, 6>; 387defm : SKLWriteResPair<WriteShuffleY, [SKLPort5], 1, [1], 1, 7>; 388defm : X86WriteResPairUnsupported<WriteShuffleZ>; 389defm : SKLWriteResPair<WriteVarShuffle, [SKLPort5], 1, [1], 1, 5>; // Vector shuffles. 390defm : SKLWriteResPair<WriteVarShuffleX, [SKLPort5], 1, [1], 1, 6>; 391defm : SKLWriteResPair<WriteVarShuffleY, [SKLPort5], 1, [1], 1, 7>; 392defm : X86WriteResPairUnsupported<WriteVarShuffleZ>; 393defm : SKLWriteResPair<WriteBlend, [SKLPort5], 1, [1], 1, 6>; // Vector blends. 394defm : SKLWriteResPair<WriteBlendY, [SKLPort5], 1, [1], 1, 7>; 395defm : X86WriteResPairUnsupported<WriteBlendZ>; 396defm : SKLWriteResPair<WriteVarBlend, [SKLPort015], 2, [2], 2, 6>; // Vector variable blends. 397defm : SKLWriteResPair<WriteVarBlendY, [SKLPort015], 2, [2], 2, 6>; 398defm : X86WriteResPairUnsupported<WriteVarBlendZ>; 399defm : SKLWriteResPair<WriteMPSAD, [SKLPort5], 4, [2], 2, 6>; // Vector MPSAD. 400defm : SKLWriteResPair<WriteMPSADY, [SKLPort5], 4, [2], 2, 7>; 401defm : X86WriteResPairUnsupported<WriteMPSADZ>; 402defm : SKLWriteResPair<WritePSADBW, [SKLPort5], 3, [1], 1, 5>; // Vector PSADBW. 403defm : SKLWriteResPair<WritePSADBWX, [SKLPort5], 3, [1], 1, 6>; 404defm : SKLWriteResPair<WritePSADBWY, [SKLPort5], 3, [1], 1, 7>; 405defm : X86WriteResPairUnsupported<WritePSADBWZ>; 406defm : SKLWriteResPair<WritePHMINPOS, [SKLPort01], 4, [1], 1, 6>; // Vector PHMINPOS. 407 408// Vector integer shifts. 409defm : SKLWriteResPair<WriteVecShift, [SKLPort0], 1, [1], 1, 5>; 410defm : X86WriteRes<WriteVecShiftX, [SKLPort5,SKLPort01], 2, [1,1], 2>; 411defm : X86WriteRes<WriteVecShiftY, [SKLPort5,SKLPort01], 4, [1,1], 2>; 412defm : X86WriteRes<WriteVecShiftXLd, [SKLPort01,SKLPort23], 7, [1,1], 2>; 413defm : X86WriteRes<WriteVecShiftYLd, [SKLPort01,SKLPort23], 8, [1,1], 2>; 414defm : X86WriteResPairUnsupported<WriteVecShiftZ>; 415 416defm : SKLWriteResPair<WriteVecShiftImm, [SKLPort0], 1, [1], 1, 5>; // Vector integer immediate shifts. 417defm : SKLWriteResPair<WriteVecShiftImmX, [SKLPort01], 1, [1], 1, 6>; 418defm : SKLWriteResPair<WriteVecShiftImmY, [SKLPort01], 1, [1], 1, 7>; 419defm : X86WriteResPairUnsupported<WriteVecShiftImmZ>; 420defm : SKLWriteResPair<WriteVarVecShift, [SKLPort01], 1, [1], 1, 6>; // Variable vector shifts. 421defm : SKLWriteResPair<WriteVarVecShiftY, [SKLPort01], 1, [1], 1, 7>; 422defm : X86WriteResPairUnsupported<WriteVarVecShiftZ>; 423 424// Vector insert/extract operations. 425def : WriteRes<WriteVecInsert, [SKLPort5]> { 426 let Latency = 2; 427 let NumMicroOps = 2; 428 let ResourceCycles = [2]; 429} 430def : WriteRes<WriteVecInsertLd, [SKLPort5,SKLPort23]> { 431 let Latency = 6; 432 let NumMicroOps = 2; 433} 434def: InstRW<[WriteVecInsertLd], (instregex "(V?)MOV(H|L)(PD|PS)rm")>; 435 436def : WriteRes<WriteVecExtract, [SKLPort0,SKLPort5]> { 437 let Latency = 3; 438 let NumMicroOps = 2; 439} 440def : WriteRes<WriteVecExtractSt, [SKLPort4,SKLPort5,SKLPort237]> { 441 let Latency = 2; 442 let NumMicroOps = 3; 443} 444 445// Conversion between integer and float. 446defm : SKLWriteResPair<WriteCvtSS2I, [SKLPort1], 3>; 447defm : SKLWriteResPair<WriteCvtPS2I, [SKLPort1], 3>; 448defm : SKLWriteResPair<WriteCvtPS2IY, [SKLPort1], 3>; 449defm : X86WriteResPairUnsupported<WriteCvtPS2IZ>; 450defm : SKLWriteResPair<WriteCvtSD2I, [SKLPort1], 3>; 451defm : SKLWriteResPair<WriteCvtPD2I, [SKLPort1], 3>; 452defm : SKLWriteResPair<WriteCvtPD2IY, [SKLPort1], 3>; 453defm : X86WriteResPairUnsupported<WriteCvtPD2IZ>; 454 455defm : SKLWriteResPair<WriteCvtI2SS, [SKLPort1], 4>; 456defm : SKLWriteResPair<WriteCvtI2PS, [SKLPort1], 4>; 457defm : SKLWriteResPair<WriteCvtI2PSY, [SKLPort1], 4>; 458defm : X86WriteResPairUnsupported<WriteCvtI2PSZ>; 459defm : SKLWriteResPair<WriteCvtI2SD, [SKLPort1], 4>; 460defm : SKLWriteResPair<WriteCvtI2PD, [SKLPort1], 4>; 461defm : SKLWriteResPair<WriteCvtI2PDY, [SKLPort1], 4>; 462defm : X86WriteResPairUnsupported<WriteCvtI2PDZ>; 463 464defm : SKLWriteResPair<WriteCvtSS2SD, [SKLPort1], 3>; 465defm : SKLWriteResPair<WriteCvtPS2PD, [SKLPort1], 3>; 466defm : SKLWriteResPair<WriteCvtPS2PDY, [SKLPort1], 3>; 467defm : X86WriteResPairUnsupported<WriteCvtPS2PDZ>; 468defm : SKLWriteResPair<WriteCvtSD2SS, [SKLPort1], 3>; 469defm : SKLWriteResPair<WriteCvtPD2PS, [SKLPort1], 3>; 470defm : SKLWriteResPair<WriteCvtPD2PSY, [SKLPort1], 3>; 471defm : X86WriteResPairUnsupported<WriteCvtPD2PSZ>; 472 473defm : X86WriteRes<WriteCvtPH2PS, [SKLPort5,SKLPort015], 5, [1,1], 2>; 474defm : X86WriteRes<WriteCvtPH2PSY, [SKLPort5,SKLPort01], 7, [1,1], 2>; 475defm : X86WriteResUnsupported<WriteCvtPH2PSZ>; 476defm : X86WriteRes<WriteCvtPH2PSLd, [SKLPort23,SKLPort01], 9, [1,1], 2>; 477defm : X86WriteRes<WriteCvtPH2PSYLd, [SKLPort23,SKLPort01], 10, [1,1], 2>; 478defm : X86WriteResUnsupported<WriteCvtPH2PSZLd>; 479 480defm : X86WriteRes<WriteCvtPS2PH, [SKLPort5,SKLPort015], 5, [1,1], 2>; 481defm : X86WriteRes<WriteCvtPS2PHY, [SKLPort5,SKLPort01], 7, [1,1], 2>; 482defm : X86WriteResUnsupported<WriteCvtPS2PHZ>; 483defm : X86WriteRes<WriteCvtPS2PHSt, [SKLPort4,SKLPort5,SKLPort237,SKLPort01], 6, [1,1,1,1], 4>; 484defm : X86WriteRes<WriteCvtPS2PHYSt, [SKLPort4,SKLPort5,SKLPort237,SKLPort01], 8, [1,1,1,1], 4>; 485defm : X86WriteResUnsupported<WriteCvtPS2PHZSt>; 486 487// Strings instructions. 488 489// Packed Compare Implicit Length Strings, Return Mask 490def : WriteRes<WritePCmpIStrM, [SKLPort0]> { 491 let Latency = 10; 492 let NumMicroOps = 3; 493 let ResourceCycles = [3]; 494} 495def : WriteRes<WritePCmpIStrMLd, [SKLPort0, SKLPort23]> { 496 let Latency = 16; 497 let NumMicroOps = 4; 498 let ResourceCycles = [3,1]; 499} 500 501// Packed Compare Explicit Length Strings, Return Mask 502def : WriteRes<WritePCmpEStrM, [SKLPort0, SKLPort5, SKLPort015, SKLPort0156]> { 503 let Latency = 19; 504 let NumMicroOps = 9; 505 let ResourceCycles = [4,3,1,1]; 506} 507def : WriteRes<WritePCmpEStrMLd, [SKLPort0, SKLPort5,SKLPort23, SKLPort015, SKLPort0156]> { 508 let Latency = 25; 509 let NumMicroOps = 10; 510 let ResourceCycles = [4,3,1,1,1]; 511} 512 513// Packed Compare Implicit Length Strings, Return Index 514def : WriteRes<WritePCmpIStrI, [SKLPort0]> { 515 let Latency = 10; 516 let NumMicroOps = 3; 517 let ResourceCycles = [3]; 518} 519def : WriteRes<WritePCmpIStrILd, [SKLPort0, SKLPort23]> { 520 let Latency = 16; 521 let NumMicroOps = 4; 522 let ResourceCycles = [3,1]; 523} 524 525// Packed Compare Explicit Length Strings, Return Index 526def : WriteRes<WritePCmpEStrI, [SKLPort0, SKLPort5, SKLPort0156]> { 527 let Latency = 18; 528 let NumMicroOps = 8; 529 let ResourceCycles = [4,3,1]; 530} 531def : WriteRes<WritePCmpEStrILd, [SKLPort0, SKLPort5, SKLPort23, SKLPort0156]> { 532 let Latency = 24; 533 let NumMicroOps = 9; 534 let ResourceCycles = [4,3,1,1]; 535} 536 537// MOVMSK Instructions. 538def : WriteRes<WriteFMOVMSK, [SKLPort0]> { let Latency = 2; } 539def : WriteRes<WriteVecMOVMSK, [SKLPort0]> { let Latency = 2; } 540def : WriteRes<WriteVecMOVMSKY, [SKLPort0]> { let Latency = 2; } 541def : WriteRes<WriteMMXMOVMSK, [SKLPort0]> { let Latency = 2; } 542 543// AES instructions. 544def : WriteRes<WriteAESDecEnc, [SKLPort0]> { // Decryption, encryption. 545 let Latency = 4; 546 let NumMicroOps = 1; 547 let ResourceCycles = [1]; 548} 549def : WriteRes<WriteAESDecEncLd, [SKLPort0, SKLPort23]> { 550 let Latency = 10; 551 let NumMicroOps = 2; 552 let ResourceCycles = [1,1]; 553} 554 555def : WriteRes<WriteAESIMC, [SKLPort0]> { // InvMixColumn. 556 let Latency = 8; 557 let NumMicroOps = 2; 558 let ResourceCycles = [2]; 559} 560def : WriteRes<WriteAESIMCLd, [SKLPort0, SKLPort23]> { 561 let Latency = 14; 562 let NumMicroOps = 3; 563 let ResourceCycles = [2,1]; 564} 565 566def : WriteRes<WriteAESKeyGen, [SKLPort0, SKLPort5, SKLPort015]> { // Key Generation. 567 let Latency = 20; 568 let NumMicroOps = 11; 569 let ResourceCycles = [3,6,2]; 570} 571def : WriteRes<WriteAESKeyGenLd, [SKLPort0, SKLPort5, SKLPort23, SKLPort015]> { 572 let Latency = 25; 573 let NumMicroOps = 11; 574 let ResourceCycles = [3,6,1,1]; 575} 576 577// Carry-less multiplication instructions. 578def : WriteRes<WriteCLMul, [SKLPort5]> { 579 let Latency = 6; 580 let NumMicroOps = 1; 581 let ResourceCycles = [1]; 582} 583def : WriteRes<WriteCLMulLd, [SKLPort5, SKLPort23]> { 584 let Latency = 12; 585 let NumMicroOps = 2; 586 let ResourceCycles = [1,1]; 587} 588 589// Catch-all for expensive system instructions. 590def : WriteRes<WriteSystem, [SKLPort0156]> { let Latency = 100; } // def WriteSystem : SchedWrite; 591 592// AVX2. 593defm : SKLWriteResPair<WriteFShuffle256, [SKLPort5], 3, [1], 1, 7>; // Fp 256-bit width vector shuffles. 594defm : SKLWriteResPair<WriteFVarShuffle256, [SKLPort5], 3, [1], 1, 7>; // Fp 256-bit width vector variable shuffles. 595defm : SKLWriteResPair<WriteShuffle256, [SKLPort5], 3, [1], 1, 7>; // 256-bit width vector shuffles. 596defm : SKLWriteResPair<WriteVPMOV256, [SKLPort5], 3, [1], 1, 7>; // 256-bit width packed vector width-changing move. 597defm : SKLWriteResPair<WriteVarShuffle256, [SKLPort5], 3, [1], 1, 7>; // 256-bit width vector variable shuffles. 598 599// Old microcoded instructions that nobody use. 600def : WriteRes<WriteMicrocoded, [SKLPort0156]> { let Latency = 100; } // def WriteMicrocoded : SchedWrite; 601 602// Fence instructions. 603def : WriteRes<WriteFence, [SKLPort23, SKLPort4]>; 604 605// Load/store MXCSR. 606def : WriteRes<WriteLDMXCSR, [SKLPort0,SKLPort23,SKLPort0156]> { let Latency = 7; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; } 607def : WriteRes<WriteSTMXCSR, [SKLPort4,SKLPort5,SKLPort237]> { let Latency = 2; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; } 608 609// Nop, not very useful expect it provides a model for nops! 610def : WriteRes<WriteNop, []>; 611 612//////////////////////////////////////////////////////////////////////////////// 613// Horizontal add/sub instructions. 614//////////////////////////////////////////////////////////////////////////////// 615 616defm : SKLWriteResPair<WriteFHAdd, [SKLPort5,SKLPort01], 6, [2,1], 3, 6>; 617defm : SKLWriteResPair<WriteFHAddY, [SKLPort5,SKLPort01], 6, [2,1], 3, 7>; 618defm : SKLWriteResPair<WritePHAdd, [SKLPort5,SKLPort05], 3, [2,1], 3, 5>; 619defm : SKLWriteResPair<WritePHAddX, [SKLPort5,SKLPort015], 3, [2,1], 3, 6>; 620defm : SKLWriteResPair<WritePHAddY, [SKLPort5,SKLPort015], 3, [2,1], 3, 7>; 621 622// Remaining instrs. 623 624def SKLWriteResGroup1 : SchedWriteRes<[SKLPort0]> { 625 let Latency = 1; 626 let NumMicroOps = 1; 627 let ResourceCycles = [1]; 628} 629def: InstRW<[SKLWriteResGroup1], (instregex "MMX_PADDS(B|W)rr", 630 "MMX_PADDUS(B|W)rr", 631 "MMX_PAVG(B|W)rr", 632 "MMX_PCMPEQ(B|D|W)rr", 633 "MMX_PCMPGT(B|D|W)rr", 634 "MMX_P(MAX|MIN)SWrr", 635 "MMX_P(MAX|MIN)UBrr", 636 "MMX_PSUBS(B|W)rr", 637 "MMX_PSUBUS(B|W)rr")>; 638 639def SKLWriteResGroup3 : SchedWriteRes<[SKLPort5]> { 640 let Latency = 1; 641 let NumMicroOps = 1; 642 let ResourceCycles = [1]; 643} 644def: InstRW<[SKLWriteResGroup3], (instregex "COM(P?)_FST0r", 645 "UCOM_F(P?)r")>; 646 647def SKLWriteResGroup4 : SchedWriteRes<[SKLPort6]> { 648 let Latency = 1; 649 let NumMicroOps = 1; 650 let ResourceCycles = [1]; 651} 652def: InstRW<[SKLWriteResGroup4], (instregex "JMP(16|32|64)r")>; 653 654def SKLWriteResGroup6 : SchedWriteRes<[SKLPort05]> { 655 let Latency = 1; 656 let NumMicroOps = 1; 657 let ResourceCycles = [1]; 658} 659def: InstRW<[SKLWriteResGroup6], (instrs FINCSTP, FNOP)>; 660 661def SKLWriteResGroup7 : SchedWriteRes<[SKLPort06]> { 662 let Latency = 1; 663 let NumMicroOps = 1; 664 let ResourceCycles = [1]; 665} 666def: InstRW<[SKLWriteResGroup7], (instrs CDQ, CQO, CLAC, STAC)>; 667 668def SKLWriteResGroup8 : SchedWriteRes<[SKLPort15]> { 669 let Latency = 1; 670 let NumMicroOps = 1; 671 let ResourceCycles = [1]; 672} 673def: InstRW<[SKLWriteResGroup8], (instregex "ANDN(32|64)rr")>; 674 675def SKLWriteResGroup9 : SchedWriteRes<[SKLPort015]> { 676 let Latency = 1; 677 let NumMicroOps = 1; 678 let ResourceCycles = [1]; 679} 680def: InstRW<[SKLWriteResGroup9], (instregex "(V?)PADD(B|D|Q|W)(Y?)rr", 681 "VPBLENDD(Y?)rri")>; 682 683def SKLWriteResGroup10 : SchedWriteRes<[SKLPort0156]> { 684 let Latency = 1; 685 let NumMicroOps = 1; 686 let ResourceCycles = [1]; 687} 688def: InstRW<[SKLWriteResGroup10], (instrs CBW, CWDE, CDQE, 689 CMC, STC, 690 SGDT64m, 691 SIDT64m, 692 SMSW16m, 693 STRm, 694 SYSCALL)>; 695 696def SKLWriteResGroup11 : SchedWriteRes<[SKLPort4,SKLPort237]> { 697 let Latency = 1; 698 let NumMicroOps = 2; 699 let ResourceCycles = [1,1]; 700} 701def: InstRW<[SKLWriteResGroup11], (instrs FBSTPm, VMPTRSTm)>; 702def: InstRW<[SKLWriteResGroup11], (instregex "ST_FP(32|64|80)m")>; 703 704def SKLWriteResGroup13 : SchedWriteRes<[SKLPort5]> { 705 let Latency = 2; 706 let NumMicroOps = 2; 707 let ResourceCycles = [2]; 708} 709def: InstRW<[SKLWriteResGroup13], (instrs MMX_MOVQ2DQrr)>; 710 711def SKLWriteResGroup14 : SchedWriteRes<[SKLPort05]> { 712 let Latency = 2; 713 let NumMicroOps = 2; 714 let ResourceCycles = [2]; 715} 716def: InstRW<[SKLWriteResGroup14], (instrs FDECSTP, 717 MMX_MOVDQ2Qrr)>; 718 719def SKLWriteResGroup17 : SchedWriteRes<[SKLPort0156]> { 720 let Latency = 2; 721 let NumMicroOps = 2; 722 let ResourceCycles = [2]; 723} 724def: InstRW<[SKLWriteResGroup17], (instrs LFENCE, 725 WAIT, 726 XGETBV)>; 727 728def SKLWriteResGroup20 : SchedWriteRes<[SKLPort6,SKLPort0156]> { 729 let Latency = 2; 730 let NumMicroOps = 2; 731 let ResourceCycles = [1,1]; 732} 733def: InstRW<[SKLWriteResGroup20], (instregex "CLFLUSH")>; 734 735def SKLWriteResGroup21 : SchedWriteRes<[SKLPort237,SKLPort0156]> { 736 let Latency = 2; 737 let NumMicroOps = 2; 738 let ResourceCycles = [1,1]; 739} 740def: InstRW<[SKLWriteResGroup21], (instrs SFENCE)>; 741 742def SKLWriteResGroup23 : SchedWriteRes<[SKLPort06,SKLPort0156]> { 743 let Latency = 2; 744 let NumMicroOps = 2; 745 let ResourceCycles = [1,1]; 746} 747def: InstRW<[SKLWriteResGroup23], (instrs CWD, 748 JCXZ, JECXZ, JRCXZ, 749 ADC8i8, SBB8i8, 750 ADC16i16, SBB16i16, 751 ADC32i32, SBB32i32, 752 ADC64i32, SBB64i32)>; 753 754def SKLWriteResGroup25 : SchedWriteRes<[SKLPort4,SKLPort6,SKLPort237]> { 755 let Latency = 2; 756 let NumMicroOps = 3; 757 let ResourceCycles = [1,1,1]; 758} 759def: InstRW<[SKLWriteResGroup25], (instrs FNSTCW16m)>; 760 761def SKLWriteResGroup27 : SchedWriteRes<[SKLPort4,SKLPort237,SKLPort15]> { 762 let Latency = 2; 763 let NumMicroOps = 3; 764 let ResourceCycles = [1,1,1]; 765} 766def: InstRW<[SKLWriteResGroup27], (instregex "MOVBE(16|32|64)mr")>; 767 768def SKLWriteResGroup28 : SchedWriteRes<[SKLPort4,SKLPort237,SKLPort0156]> { 769 let Latency = 2; 770 let NumMicroOps = 3; 771 let ResourceCycles = [1,1,1]; 772} 773def: InstRW<[SKLWriteResGroup28], (instrs PUSH16r, PUSH32r, PUSH64r, PUSH64i8, 774 STOSB, STOSL, STOSQ, STOSW)>; 775def: InstRW<[SKLWriteResGroup28], (instregex "PUSH(16|32|64)rmr")>; 776 777def SKLWriteResGroup29 : SchedWriteRes<[SKLPort1]> { 778 let Latency = 3; 779 let NumMicroOps = 1; 780 let ResourceCycles = [1]; 781} 782def: InstRW<[SKLWriteResGroup29], (instregex "PDEP(32|64)rr", 783 "PEXT(32|64)rr")>; 784 785def SKLWriteResGroup30 : SchedWriteRes<[SKLPort5]> { 786 let Latency = 3; 787 let NumMicroOps = 1; 788 let ResourceCycles = [1]; 789} 790def: InstRW<[SKLWriteResGroup30], (instregex "(ADD|SUB|SUBR)_(FPrST0|FST0r|FrST0)", 791 "VPBROADCAST(B|W)rr")>; 792 793def SKLWriteResGroup32 : SchedWriteRes<[SKLPort0,SKLPort0156]> { 794 let Latency = 3; 795 let NumMicroOps = 2; 796 let ResourceCycles = [1,1]; 797} 798def: InstRW<[SKLWriteResGroup32], (instrs FNSTSW16r)>; 799 800def SKLWriteResGroup35 : SchedWriteRes<[SKLPort0,SKLPort5]> { 801 let Latency = 3; 802 let NumMicroOps = 3; 803 let ResourceCycles = [1,2]; 804} 805def: InstRW<[SKLWriteResGroup35], (instregex "MMX_PH(ADD|SUB)SWrr")>; 806 807def SKLWriteResGroup36 : SchedWriteRes<[SKLPort5,SKLPort01]> { 808 let Latency = 3; 809 let NumMicroOps = 3; 810 let ResourceCycles = [2,1]; 811} 812def: InstRW<[SKLWriteResGroup36], (instregex "(V?)PHADDSW(Y?)rr", 813 "(V?)PHSUBSW(Y?)rr")>; 814 815def SKLWriteResGroup39 : SchedWriteRes<[SKLPort5,SKLPort0156]> { 816 let Latency = 3; 817 let NumMicroOps = 3; 818 let ResourceCycles = [2,1]; 819} 820def: InstRW<[SKLWriteResGroup39], (instrs MMX_PACKSSDWrr, 821 MMX_PACKSSWBrr, 822 MMX_PACKUSWBrr)>; 823 824def SKLWriteResGroup40 : SchedWriteRes<[SKLPort6,SKLPort0156]> { 825 let Latency = 3; 826 let NumMicroOps = 3; 827 let ResourceCycles = [1,2]; 828} 829def: InstRW<[SKLWriteResGroup40], (instregex "CLD")>; 830 831def SKLWriteResGroup41 : SchedWriteRes<[SKLPort237,SKLPort0156]> { 832 let Latency = 3; 833 let NumMicroOps = 3; 834 let ResourceCycles = [1,2]; 835} 836def: InstRW<[SKLWriteResGroup41], (instrs MFENCE)>; 837 838def SKLWriteResGroup42 : SchedWriteRes<[SKLPort06,SKLPort0156]> { 839 let Latency = 3; 840 let NumMicroOps = 3; 841 let ResourceCycles = [1,2]; 842} 843def: InstRW<[SKLWriteResGroup42], (instregex "RCL(8|16|32|64)r(1|i)", 844 "RCR(8|16|32|64)r(1|i)")>; 845 846def SKLWriteResGroup43 : SchedWriteRes<[SKLPort0,SKLPort4,SKLPort237]> { 847 let Latency = 3; 848 let NumMicroOps = 3; 849 let ResourceCycles = [1,1,1]; 850} 851def: InstRW<[SKLWriteResGroup43], (instrs FNSTSWm)>; 852 853def SKLWriteResGroup45 : SchedWriteRes<[SKLPort4,SKLPort6,SKLPort237,SKLPort0156]> { 854 let Latency = 3; 855 let NumMicroOps = 4; 856 let ResourceCycles = [1,1,1,1]; 857} 858def: InstRW<[SKLWriteResGroup45], (instregex "CALL(16|32|64)r")>; 859 860def SKLWriteResGroup46 : SchedWriteRes<[SKLPort4,SKLPort237,SKLPort06,SKLPort0156]> { 861 let Latency = 3; 862 let NumMicroOps = 4; 863 let ResourceCycles = [1,1,1,1]; 864} 865def: InstRW<[SKLWriteResGroup46], (instrs CALL64pcrel32)>; 866 867def SKLWriteResGroup47 : SchedWriteRes<[SKLPort0]> { 868 let Latency = 4; 869 let NumMicroOps = 1; 870 let ResourceCycles = [1]; 871} 872def: InstRW<[SKLWriteResGroup47], (instregex "MUL_(FPrST0|FST0r|FrST0)")>; 873 874def SKLWriteResGroup48 : SchedWriteRes<[SKLPort01]> { 875 let Latency = 4; 876 let NumMicroOps = 1; 877 let ResourceCycles = [1]; 878} 879def: InstRW<[SKLWriteResGroup48], (instregex "(V?)CVTDQ2PS(Y?)rr", 880 "(V?)CVT(T?)PS2DQ(Y?)rr")>; 881 882def SKLWriteResGroup53 : SchedWriteRes<[SKLPort4,SKLPort5,SKLPort237]> { 883 let Latency = 4; 884 let NumMicroOps = 3; 885 let ResourceCycles = [1,1,1]; 886} 887def: InstRW<[SKLWriteResGroup53], (instregex "IST(T?)_FP(16|32|64)m", 888 "IST_F(16|32)m")>; 889 890def SKLWriteResGroup54 : SchedWriteRes<[SKLPort0156]> { 891 let Latency = 4; 892 let NumMicroOps = 4; 893 let ResourceCycles = [4]; 894} 895def: InstRW<[SKLWriteResGroup54], (instrs FNCLEX)>; 896 897def SKLWriteResGroup55 : SchedWriteRes<[SKLPort6,SKLPort0156]> { 898 let Latency = 4; 899 let NumMicroOps = 4; 900 let ResourceCycles = [1,3]; 901} 902def: InstRW<[SKLWriteResGroup55], (instrs PAUSE)>; 903 904def SKLWriteResGroup56 : SchedWriteRes<[]> { 905 let Latency = 0; 906 let NumMicroOps = 4; 907 let ResourceCycles = []; 908} 909def: InstRW<[SKLWriteResGroup56], (instrs VZEROUPPER)>; 910 911def SKLWriteResGroup57 : SchedWriteRes<[SKLPort1,SKLPort6,SKLPort0156]> { 912 let Latency = 4; 913 let NumMicroOps = 4; 914 let ResourceCycles = [1,1,2]; 915} 916def: InstRW<[SKLWriteResGroup57], (instregex "LAR(16|32|64)rr")>; 917 918def SKLWriteResGroup58 : SchedWriteRes<[SKLPort23]> { 919 let Latency = 5; 920 let NumMicroOps = 1; 921 let ResourceCycles = [1]; 922} 923def: InstRW<[SKLWriteResGroup58], (instregex "MOVSX(16|32|64)rm(8|16|32)", 924 "MOVZX(16|32|64)rm(8|16)", 925 "(V?)MOVDDUPrm")>; // TODO: Should this be SKLWriteResGroup67? 926 927def SKLWriteResGroup59 : SchedWriteRes<[SKLPort0,SKLPort5]> { 928 let Latency = 5; 929 let NumMicroOps = 2; 930 let ResourceCycles = [1,1]; 931} 932def: InstRW<[SKLWriteResGroup59], (instrs MMX_CVTPI2PDrr, 933 CVTDQ2PDrr, 934 VCVTDQ2PDrr)>; 935 936def SKLWriteResGroup60 : SchedWriteRes<[SKLPort5,SKLPort015]> { 937 let Latency = 5; 938 let NumMicroOps = 2; 939 let ResourceCycles = [1,1]; 940} 941def: InstRW<[SKLWriteResGroup60], (instregex "MMX_CVT(T?)PD2PIrr", 942 "MMX_CVT(T?)PS2PIrr", 943 "(V?)CVT(T?)PD2DQrr", 944 "(V?)CVTPD2PSrr", 945 "(V?)CVTPS2PDrr", 946 "(V?)CVTSD2SSrr", 947 "(V?)CVTSI642SDrr", 948 "(V?)CVTSI2SDrr", 949 "(V?)CVTSI2SSrr", 950 "(V?)CVTSS2SDrr")>; 951 952def SKLWriteResGroup61 : SchedWriteRes<[SKLPort1,SKLPort6,SKLPort06]> { 953 let Latency = 5; 954 let NumMicroOps = 3; 955 let ResourceCycles = [1,1,1]; 956} 957def: InstRW<[SKLWriteResGroup61], (instregex "STR(16|32|64)r")>; 958 959def SKLWriteResGroup63 : SchedWriteRes<[SKLPort06,SKLPort0156]> { 960 let Latency = 5; 961 let NumMicroOps = 5; 962 let ResourceCycles = [1,4]; 963} 964def: InstRW<[SKLWriteResGroup63], (instrs XSETBV)>; 965 966def SKLWriteResGroup65 : SchedWriteRes<[SKLPort4,SKLPort237,SKLPort0156]> { 967 let Latency = 5; 968 let NumMicroOps = 6; 969 let ResourceCycles = [1,1,4]; 970} 971def: InstRW<[SKLWriteResGroup65], (instregex "PUSHF(16|64)")>; 972 973def SKLWriteResGroup67 : SchedWriteRes<[SKLPort23]> { 974 let Latency = 6; 975 let NumMicroOps = 1; 976 let ResourceCycles = [1]; 977} 978def: InstRW<[SKLWriteResGroup67], (instrs VBROADCASTSSrm, 979 VPBROADCASTDrm, 980 VPBROADCASTQrm)>; 981def: InstRW<[SKLWriteResGroup67], (instregex "(V?)MOVSHDUPrm", 982 "(V?)MOVSLDUPrm")>; 983 984def SKLWriteResGroup68 : SchedWriteRes<[SKLPort0]> { 985 let Latency = 6; 986 let NumMicroOps = 2; 987 let ResourceCycles = [2]; 988} 989def: InstRW<[SKLWriteResGroup68], (instrs MMX_CVTPI2PSrr)>; 990 991def SKLWriteResGroup69 : SchedWriteRes<[SKLPort0,SKLPort23]> { 992 let Latency = 6; 993 let NumMicroOps = 2; 994 let ResourceCycles = [1,1]; 995} 996def: InstRW<[SKLWriteResGroup69], (instrs MMX_PADDSBrm, 997 MMX_PADDSWrm, 998 MMX_PADDUSBrm, 999 MMX_PADDUSWrm, 1000 MMX_PAVGBrm, 1001 MMX_PAVGWrm, 1002 MMX_PCMPEQBrm, 1003 MMX_PCMPEQDrm, 1004 MMX_PCMPEQWrm, 1005 MMX_PCMPGTBrm, 1006 MMX_PCMPGTDrm, 1007 MMX_PCMPGTWrm, 1008 MMX_PMAXSWrm, 1009 MMX_PMAXUBrm, 1010 MMX_PMINSWrm, 1011 MMX_PMINUBrm, 1012 MMX_PSUBSBrm, 1013 MMX_PSUBSWrm, 1014 MMX_PSUBUSBrm, 1015 MMX_PSUBUSWrm)>; 1016 1017def SKLWriteResGroup70 : SchedWriteRes<[SKLPort0,SKLPort01]> { 1018 let Latency = 6; 1019 let NumMicroOps = 2; 1020 let ResourceCycles = [1,1]; 1021} 1022def: InstRW<[SKLWriteResGroup70], (instregex "(V?)CVTSS2SI(64)?rr", 1023 "(V?)CVT(T?)SD2SI(64)?rr")>; 1024 1025def SKLWriteResGroup72 : SchedWriteRes<[SKLPort6,SKLPort23]> { 1026 let Latency = 6; 1027 let NumMicroOps = 2; 1028 let ResourceCycles = [1,1]; 1029} 1030def: InstRW<[SKLWriteResGroup72], (instrs FARJMP64m)>; 1031def: InstRW<[SKLWriteResGroup72], (instregex "JMP(16|32|64)m")>; 1032 1033def SKLWriteResGroup75 : SchedWriteRes<[SKLPort23,SKLPort15]> { 1034 let Latency = 6; 1035 let NumMicroOps = 2; 1036 let ResourceCycles = [1,1]; 1037} 1038def: InstRW<[SKLWriteResGroup75], (instregex "ANDN(32|64)rm", 1039 "MOVBE(16|32|64)rm")>; 1040 1041def SKLWriteResGroup76 : SchedWriteRes<[SKLPort23,SKLPort0156]> { 1042 let Latency = 6; 1043 let NumMicroOps = 2; 1044 let ResourceCycles = [1,1]; 1045} 1046def: InstRW<[SKLWriteResGroup76], (instrs POP16r, POP32r, POP64r)>; 1047def: InstRW<[SKLWriteResGroup76], (instregex "POP(16|32|64)rmr")>; 1048 1049def SKLWriteResGroup78 : SchedWriteRes<[SKLPort5,SKLPort01]> { 1050 let Latency = 6; 1051 let NumMicroOps = 3; 1052 let ResourceCycles = [2,1]; 1053} 1054def: InstRW<[SKLWriteResGroup78], (instregex "(V?)CVTSI642SSrr")>; 1055 1056def SKLWriteResGroup80 : SchedWriteRes<[SKLPort1,SKLPort6,SKLPort06,SKLPort0156]> { 1057 let Latency = 6; 1058 let NumMicroOps = 4; 1059 let ResourceCycles = [1,1,1,1]; 1060} 1061def: InstRW<[SKLWriteResGroup80], (instregex "SLDT(16|32|64)r")>; 1062 1063def SKLWriteResGroup82 : SchedWriteRes<[SKLPort4,SKLPort23,SKLPort237,SKLPort06]> { 1064 let Latency = 6; 1065 let NumMicroOps = 4; 1066 let ResourceCycles = [1,1,1,1]; 1067} 1068def: InstRW<[SKLWriteResGroup82], (instregex "SAR(8|16|32|64)m(1|i)", 1069 "SHL(8|16|32|64)m(1|i)", 1070 "SHR(8|16|32|64)m(1|i)")>; 1071 1072def SKLWriteResGroup83 : SchedWriteRes<[SKLPort4,SKLPort23,SKLPort237,SKLPort0156]> { 1073 let Latency = 6; 1074 let NumMicroOps = 4; 1075 let ResourceCycles = [1,1,1,1]; 1076} 1077def: InstRW<[SKLWriteResGroup83], (instregex "POP(16|32|64)rmm", 1078 "PUSH(16|32|64)rmm")>; 1079 1080def SKLWriteResGroup84 : SchedWriteRes<[SKLPort6,SKLPort0156]> { 1081 let Latency = 6; 1082 let NumMicroOps = 6; 1083 let ResourceCycles = [1,5]; 1084} 1085def: InstRW<[SKLWriteResGroup84], (instrs STD)>; 1086 1087def SKLWriteResGroup85 : SchedWriteRes<[SKLPort23]> { 1088 let Latency = 7; 1089 let NumMicroOps = 1; 1090 let ResourceCycles = [1]; 1091} 1092def: InstRW<[SKLWriteResGroup85], (instregex "LD_F(32|64|80)m")>; 1093def: InstRW<[SKLWriteResGroup85], (instrs VBROADCASTF128, 1094 VBROADCASTI128, 1095 VBROADCASTSDYrm, 1096 VBROADCASTSSYrm, 1097 VMOVDDUPYrm, 1098 VMOVSHDUPYrm, 1099 VMOVSLDUPYrm, 1100 VPBROADCASTDYrm, 1101 VPBROADCASTQYrm)>; 1102 1103def SKLWriteResGroup86 : SchedWriteRes<[SKLPort0,SKLPort5]> { 1104 let Latency = 7; 1105 let NumMicroOps = 2; 1106 let ResourceCycles = [1,1]; 1107} 1108def: InstRW<[SKLWriteResGroup86], (instrs VCVTDQ2PDYrr)>; 1109 1110def SKLWriteResGroup88 : SchedWriteRes<[SKLPort5,SKLPort23]> { 1111 let Latency = 6; 1112 let NumMicroOps = 2; 1113 let ResourceCycles = [1,1]; 1114} 1115def: InstRW<[SKLWriteResGroup88], (instregex "(V?)PMOV(SX|ZX)BDrm", 1116 "(V?)PMOV(SX|ZX)BQrm", 1117 "(V?)PMOV(SX|ZX)BWrm", 1118 "(V?)PMOV(SX|ZX)DQrm", 1119 "(V?)PMOV(SX|ZX)WDrm", 1120 "(V?)PMOV(SX|ZX)WQrm")>; 1121 1122def SKLWriteResGroup89 : SchedWriteRes<[SKLPort5,SKLPort01]> { 1123 let Latency = 7; 1124 let NumMicroOps = 2; 1125 let ResourceCycles = [1,1]; 1126} 1127def: InstRW<[SKLWriteResGroup89], (instrs VCVTPD2PSYrr, 1128 VCVTPS2PDYrr, 1129 VCVTPD2DQYrr, 1130 VCVTTPD2DQYrr)>; 1131 1132def SKLWriteResGroup91 : SchedWriteRes<[SKLPort23,SKLPort015]> { 1133 let Latency = 7; 1134 let NumMicroOps = 2; 1135 let ResourceCycles = [1,1]; 1136} 1137def: InstRW<[SKLWriteResGroup91], (instrs VINSERTF128rm, 1138 VINSERTI128rm, 1139 VPBLENDDrmi)>; 1140def: InstRW<[SKLWriteResGroup91, ReadAfterVecXLd], 1141 (instregex "(V?)PADD(B|D|Q|W)rm", 1142 "(V?)PSUB(B|D|Q|W)rm")>; 1143 1144def SKLWriteResGroup92 : SchedWriteRes<[SKLPort5,SKLPort23]> { 1145 let Latency = 7; 1146 let NumMicroOps = 3; 1147 let ResourceCycles = [2,1]; 1148} 1149def: InstRW<[SKLWriteResGroup92], (instrs MMX_PACKSSDWrm, 1150 MMX_PACKSSWBrm, 1151 MMX_PACKUSWBrm)>; 1152 1153def SKLWriteResGroup94 : SchedWriteRes<[SKLPort23,SKLPort0156]> { 1154 let Latency = 7; 1155 let NumMicroOps = 3; 1156 let ResourceCycles = [1,2]; 1157} 1158def: InstRW<[SKLWriteResGroup94], (instrs LEAVE, LEAVE64, 1159 SCASB, SCASL, SCASQ, SCASW)>; 1160 1161def SKLWriteResGroup95 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort01]> { 1162 let Latency = 7; 1163 let NumMicroOps = 3; 1164 let ResourceCycles = [1,1,1]; 1165} 1166def: InstRW<[SKLWriteResGroup95], (instregex "(V?)CVTTSS2SI(64)?rr")>; 1167 1168def SKLWriteResGroup96 : SchedWriteRes<[SKLPort0,SKLPort23,SKLPort05]> { 1169 let Latency = 7; 1170 let NumMicroOps = 3; 1171 let ResourceCycles = [1,1,1]; 1172} 1173def: InstRW<[SKLWriteResGroup96], (instrs FLDCW16m)>; 1174 1175def SKLWriteResGroup98 : SchedWriteRes<[SKLPort6,SKLPort23,SKLPort0156]> { 1176 let Latency = 7; 1177 let NumMicroOps = 3; 1178 let ResourceCycles = [1,1,1]; 1179} 1180def: InstRW<[SKLWriteResGroup98], (instrs LRET64, RET64)>; 1181 1182def SKLWriteResGroup100 : SchedWriteRes<[SKLPort4,SKLPort23,SKLPort237,SKLPort06]> { 1183 let Latency = 7; 1184 let NumMicroOps = 5; 1185 let ResourceCycles = [1,1,1,2]; 1186} 1187def: InstRW<[SKLWriteResGroup100], (instregex "ROL(8|16|32|64)m(1|i)", 1188 "ROR(8|16|32|64)m(1|i)")>; 1189 1190def SKLWriteResGroup100_1 : SchedWriteRes<[SKLPort06]> { 1191 let Latency = 2; 1192 let NumMicroOps = 2; 1193 let ResourceCycles = [2]; 1194} 1195def: InstRW<[SKLWriteResGroup100_1], (instrs ROL8r1, ROL16r1, ROL32r1, ROL64r1, 1196 ROR8r1, ROR16r1, ROR32r1, ROR64r1)>; 1197 1198def SKLWriteResGroup101 : SchedWriteRes<[SKLPort4,SKLPort23,SKLPort237,SKLPort0156]> { 1199 let Latency = 7; 1200 let NumMicroOps = 5; 1201 let ResourceCycles = [1,1,1,2]; 1202} 1203def: InstRW<[SKLWriteResGroup101], (instregex "XADD(8|16|32|64)rm")>; 1204 1205def SKLWriteResGroup102 : SchedWriteRes<[SKLPort4,SKLPort6,SKLPort23,SKLPort237,SKLPort0156]> { 1206 let Latency = 7; 1207 let NumMicroOps = 5; 1208 let ResourceCycles = [1,1,1,1,1]; 1209} 1210def: InstRW<[SKLWriteResGroup102], (instregex "CALL(16|32|64)m")>; 1211def: InstRW<[SKLWriteResGroup102], (instrs FARCALL64m)>; 1212 1213def SKLWriteResGroup103 : SchedWriteRes<[SKLPort6,SKLPort06,SKLPort15,SKLPort0156]> { 1214 let Latency = 7; 1215 let NumMicroOps = 7; 1216 let ResourceCycles = [1,3,1,2]; 1217} 1218def: InstRW<[SKLWriteResGroup103], (instrs LOOP)>; 1219 1220def SKLWriteResGroup107 : SchedWriteRes<[SKLPort1,SKLPort23]> { 1221 let Latency = 8; 1222 let NumMicroOps = 2; 1223 let ResourceCycles = [1,1]; 1224} 1225def: InstRW<[SKLWriteResGroup107], (instregex "PDEP(32|64)rm", 1226 "PEXT(32|64)rm")>; 1227 1228def SKLWriteResGroup108 : SchedWriteRes<[SKLPort5,SKLPort23]> { 1229 let Latency = 8; 1230 let NumMicroOps = 2; 1231 let ResourceCycles = [1,1]; 1232} 1233def: InstRW<[SKLWriteResGroup108], (instregex "FCOM(P?)(32|64)m")>; 1234def: InstRW<[SKLWriteResGroup108], (instrs VPBROADCASTBYrm, 1235 VPBROADCASTWYrm, 1236 VPMOVSXBDYrm, 1237 VPMOVSXBQYrm, 1238 VPMOVSXWQYrm)>; 1239 1240def SKLWriteResGroup110 : SchedWriteRes<[SKLPort23,SKLPort015]> { 1241 let Latency = 8; 1242 let NumMicroOps = 2; 1243 let ResourceCycles = [1,1]; 1244} 1245def: InstRW<[SKLWriteResGroup110], (instrs VPBLENDDYrmi)>; 1246def: InstRW<[SKLWriteResGroup110, ReadAfterVecYLd], 1247 (instregex "VPADD(B|D|Q|W)Yrm", 1248 "VPSUB(B|D|Q|W)Yrm")>; 1249 1250def SKLWriteResGroup112 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23]> { 1251 let Latency = 8; 1252 let NumMicroOps = 4; 1253 let ResourceCycles = [1,2,1]; 1254} 1255def: InstRW<[SKLWriteResGroup112], (instregex "MMX_PH(ADD|SUB)SWrm")>; 1256 1257def SKLWriteResGroup116 : SchedWriteRes<[SKLPort23,SKLPort237,SKLPort06,SKLPort0156]> { 1258 let Latency = 8; 1259 let NumMicroOps = 5; 1260 let ResourceCycles = [1,1,1,2]; 1261} 1262def: InstRW<[SKLWriteResGroup116], (instregex "RCL(8|16|32|64)m(1|i)", 1263 "RCR(8|16|32|64)m(1|i)")>; 1264 1265def SKLWriteResGroup117 : SchedWriteRes<[SKLPort4,SKLPort23,SKLPort237,SKLPort06]> { 1266 let Latency = 8; 1267 let NumMicroOps = 6; 1268 let ResourceCycles = [1,1,1,3]; 1269} 1270def: InstRW<[SKLWriteResGroup117], (instregex "ROL(8|16|32|64)mCL", 1271 "ROR(8|16|32|64)mCL", 1272 "SAR(8|16|32|64)mCL", 1273 "SHL(8|16|32|64)mCL", 1274 "SHR(8|16|32|64)mCL")>; 1275 1276def SKLWriteResGroup119 : SchedWriteRes<[SKLPort4,SKLPort23,SKLPort237,SKLPort06,SKLPort0156]> { 1277 let Latency = 8; 1278 let NumMicroOps = 6; 1279 let ResourceCycles = [1,1,1,2,1]; 1280} 1281def: SchedAlias<WriteADCRMW, SKLWriteResGroup119>; 1282 1283def SKLWriteResGroup120 : SchedWriteRes<[SKLPort0,SKLPort23]> { 1284 let Latency = 9; 1285 let NumMicroOps = 2; 1286 let ResourceCycles = [1,1]; 1287} 1288def: InstRW<[SKLWriteResGroup120], (instrs MMX_CVTPI2PSrm)>; 1289 1290def SKLWriteResGroup121 : SchedWriteRes<[SKLPort5,SKLPort23]> { 1291 let Latency = 9; 1292 let NumMicroOps = 2; 1293 let ResourceCycles = [1,1]; 1294} 1295def: InstRW<[SKLWriteResGroup121], (instrs PCMPGTQrm, 1296 VPCMPGTQrm, 1297 VPMOVSXBWYrm, 1298 VPMOVSXDQYrm, 1299 VPMOVSXWDYrm, 1300 VPMOVZXWDYrm)>; 1301 1302def SKLWriteResGroup123 : SchedWriteRes<[SKLPort23,SKLPort01]> { 1303 let Latency = 9; 1304 let NumMicroOps = 2; 1305 let ResourceCycles = [1,1]; 1306} 1307def: InstRW<[SKLWriteResGroup123], (instregex "MMX_CVT(T?)PS2PIrm", 1308 "(V?)CVTPS2PDrm")>; 1309 1310def SKLWriteResGroup128 : SchedWriteRes<[SKLPort5,SKLPort01,SKLPort23]> { 1311 let Latency = 9; 1312 let NumMicroOps = 4; 1313 let ResourceCycles = [2,1,1]; 1314} 1315def: InstRW<[SKLWriteResGroup128], (instregex "(V?)PHADDSWrm", 1316 "(V?)PHSUBSWrm")>; 1317 1318def SKLWriteResGroup131 : SchedWriteRes<[SKLPort1,SKLPort6,SKLPort23,SKLPort0156]> { 1319 let Latency = 9; 1320 let NumMicroOps = 5; 1321 let ResourceCycles = [1,2,1,1]; 1322} 1323def: InstRW<[SKLWriteResGroup131], (instregex "LAR(16|32|64)rm", 1324 "LSL(16|32|64)rm")>; 1325 1326def SKLWriteResGroup133 : SchedWriteRes<[SKLPort5,SKLPort23]> { 1327 let Latency = 10; 1328 let NumMicroOps = 2; 1329 let ResourceCycles = [1,1]; 1330} 1331def: InstRW<[SKLWriteResGroup133], (instregex "(ADD|SUB|SUBR)_F(32|64)m", 1332 "ILD_F(16|32|64)m")>; 1333def: InstRW<[SKLWriteResGroup133], (instrs VPCMPGTQYrm)>; 1334 1335def SKLWriteResGroup134 : SchedWriteRes<[SKLPort01,SKLPort23]> { 1336 let Latency = 10; 1337 let NumMicroOps = 2; 1338 let ResourceCycles = [1,1]; 1339} 1340def: InstRW<[SKLWriteResGroup134], (instregex "(V?)CVTDQ2PSrm", 1341 "(V?)CVTPS2DQrm", 1342 "(V?)CVTSS2SDrm", 1343 "(V?)CVTTPS2DQrm")>; 1344 1345def SKLWriteResGroup138 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23]> { 1346 let Latency = 10; 1347 let NumMicroOps = 3; 1348 let ResourceCycles = [1,1,1]; 1349} 1350def: InstRW<[SKLWriteResGroup138], (instrs MMX_CVTPI2PDrm)>; 1351 1352def SKLWriteResGroup139 : SchedWriteRes<[SKLPort5,SKLPort23,SKLPort01]> { 1353 let Latency = 10; 1354 let NumMicroOps = 3; 1355 let ResourceCycles = [1,1,1]; 1356} 1357def: InstRW<[SKLWriteResGroup139], (instregex "(V?)CVTSD2SSrm")>; 1358 1359def SKLWriteResGroup140 : SchedWriteRes<[SKLPort5,SKLPort01,SKLPort23]> { 1360 let Latency = 10; 1361 let NumMicroOps = 4; 1362 let ResourceCycles = [2,1,1]; 1363} 1364def: InstRW<[SKLWriteResGroup140], (instrs VPHADDSWYrm, 1365 VPHSUBSWYrm)>; 1366 1367def SKLWriteResGroup143 : SchedWriteRes<[SKLPort4,SKLPort6,SKLPort23,SKLPort237,SKLPort06,SKLPort0156]> { 1368 let Latency = 10; 1369 let NumMicroOps = 8; 1370 let ResourceCycles = [1,1,1,1,1,3]; 1371} 1372def: InstRW<[SKLWriteResGroup143], (instregex "XCHG(8|16|32|64)rm")>; 1373 1374def SKLWriteResGroup145 : SchedWriteRes<[SKLPort0,SKLFPDivider]> { 1375 let Latency = 11; 1376 let NumMicroOps = 1; 1377 let ResourceCycles = [1,3]; 1378} 1379def : SchedAlias<WriteFDivX, SKLWriteResGroup145>; // TODO - convert to ZnWriteResFpuPair 1380 1381def SKLWriteResGroup146 : SchedWriteRes<[SKLPort0,SKLPort23]> { 1382 let Latency = 11; 1383 let NumMicroOps = 2; 1384 let ResourceCycles = [1,1]; 1385} 1386def: InstRW<[SKLWriteResGroup146], (instregex "MUL_F(32|64)m")>; 1387 1388def SKLWriteResGroup147 : SchedWriteRes<[SKLPort01,SKLPort23]> { 1389 let Latency = 11; 1390 let NumMicroOps = 2; 1391 let ResourceCycles = [1,1]; 1392} 1393def: InstRW<[SKLWriteResGroup147], (instrs VCVTDQ2PSYrm, 1394 VCVTPS2PDYrm, 1395 VCVTPS2DQYrm, 1396 VCVTTPS2DQYrm)>; 1397 1398def SKLWriteResGroup149 : SchedWriteRes<[SKLPort5,SKLPort23]> { 1399 let Latency = 11; 1400 let NumMicroOps = 3; 1401 let ResourceCycles = [2,1]; 1402} 1403def: InstRW<[SKLWriteResGroup149], (instregex "FICOM(P?)(16|32)m")>; 1404 1405def SKLWriteResGroup150 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23]> { 1406 let Latency = 11; 1407 let NumMicroOps = 3; 1408 let ResourceCycles = [1,1,1]; 1409} 1410def: InstRW<[SKLWriteResGroup150], (instregex "(V?)CVTDQ2PDrm")>; 1411 1412def SKLWriteResGroup151 : SchedWriteRes<[SKLPort0,SKLPort23,SKLPort01]> { 1413 let Latency = 11; 1414 let NumMicroOps = 3; 1415 let ResourceCycles = [1,1,1]; 1416} 1417def: InstRW<[SKLWriteResGroup151], (instregex "(V?)CVTSS2SI64rm", 1418 "(V?)CVT(T?)SD2SI(64)?rm", 1419 "VCVTTSS2SI64rm", 1420 "(V?)CVT(T?)SS2SIrm")>; 1421 1422def SKLWriteResGroup152 : SchedWriteRes<[SKLPort5,SKLPort23,SKLPort01]> { 1423 let Latency = 11; 1424 let NumMicroOps = 3; 1425 let ResourceCycles = [1,1,1]; 1426} 1427def: InstRW<[SKLWriteResGroup152], (instrs CVTPD2PSrm, 1428 CVTPD2DQrm, 1429 CVTTPD2DQrm, 1430 MMX_CVTPD2PIrm, 1431 MMX_CVTTPD2PIrm)>; 1432 1433def SKLWriteResGroup154 : SchedWriteRes<[SKLPort1,SKLPort06,SKLPort0156]> { 1434 let Latency = 11; 1435 let NumMicroOps = 7; 1436 let ResourceCycles = [2,3,2]; 1437} 1438def: InstRW<[SKLWriteResGroup154], (instregex "RCL(16|32|64)rCL", 1439 "RCR(16|32|64)rCL")>; 1440 1441def SKLWriteResGroup155 : SchedWriteRes<[SKLPort1,SKLPort06,SKLPort15,SKLPort0156]> { 1442 let Latency = 11; 1443 let NumMicroOps = 9; 1444 let ResourceCycles = [1,5,1,2]; 1445} 1446def: InstRW<[SKLWriteResGroup155], (instrs RCL8rCL)>; 1447 1448def SKLWriteResGroup156 : SchedWriteRes<[SKLPort06,SKLPort0156]> { 1449 let Latency = 11; 1450 let NumMicroOps = 11; 1451 let ResourceCycles = [2,9]; 1452} 1453def: InstRW<[SKLWriteResGroup156], (instrs LOOPE, LOOPNE)>; 1454 1455def SKLWriteResGroup160 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23,SKLPort01]> { 1456 let Latency = 12; 1457 let NumMicroOps = 4; 1458 let ResourceCycles = [1,1,1,1]; 1459} 1460def: InstRW<[SKLWriteResGroup160], (instregex "CVTTSS2SI64rm")>; 1461 1462def SKLWriteResGroup162 : SchedWriteRes<[SKLPort5,SKLPort23]> { 1463 let Latency = 13; 1464 let NumMicroOps = 3; 1465 let ResourceCycles = [2,1]; 1466} 1467def: InstRW<[SKLWriteResGroup162], (instregex "(ADD|SUB|SUBR)_FI(16|32)m")>; 1468 1469def SKLWriteResGroup163 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23]> { 1470 let Latency = 13; 1471 let NumMicroOps = 3; 1472 let ResourceCycles = [1,1,1]; 1473} 1474def: InstRW<[SKLWriteResGroup163], (instrs VCVTDQ2PDYrm)>; 1475 1476def SKLWriteResGroup166 : SchedWriteRes<[SKLPort0,SKLFPDivider]> { 1477 let Latency = 14; 1478 let NumMicroOps = 1; 1479 let ResourceCycles = [1,3]; 1480} 1481def : SchedAlias<WriteFDiv64, SKLWriteResGroup166>; // TODO - convert to ZnWriteResFpuPair 1482def : SchedAlias<WriteFDiv64X, SKLWriteResGroup166>; // TODO - convert to ZnWriteResFpuPair 1483 1484def SKLWriteResGroup166_1 : SchedWriteRes<[SKLPort0,SKLFPDivider]> { 1485 let Latency = 14; 1486 let NumMicroOps = 1; 1487 let ResourceCycles = [1,5]; 1488} 1489def : SchedAlias<WriteFDiv64Y, SKLWriteResGroup166_1>; // TODO - convert to ZnWriteResFpuPair 1490 1491def SKLWriteResGroup169 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23]> { 1492 let Latency = 14; 1493 let NumMicroOps = 3; 1494 let ResourceCycles = [1,1,1]; 1495} 1496def: InstRW<[SKLWriteResGroup169], (instregex "MUL_FI(16|32)m")>; 1497 1498def SKLWriteResGroup170 : SchedWriteRes<[SKLPort1,SKLPort06,SKLPort15,SKLPort0156]> { 1499 let Latency = 14; 1500 let NumMicroOps = 10; 1501 let ResourceCycles = [2,4,1,3]; 1502} 1503def: InstRW<[SKLWriteResGroup170], (instrs RCR8rCL)>; 1504 1505def SKLWriteResGroup171 : SchedWriteRes<[SKLPort0]> { 1506 let Latency = 15; 1507 let NumMicroOps = 1; 1508 let ResourceCycles = [1]; 1509} 1510def: InstRW<[SKLWriteResGroup171], (instregex "DIVR_(FPrST0|FST0r|FrST0)")>; 1511 1512def SKLWriteResGroup174 : SchedWriteRes<[SKLPort1,SKLPort23,SKLPort237,SKLPort06,SKLPort15,SKLPort0156]> { 1513 let Latency = 15; 1514 let NumMicroOps = 10; 1515 let ResourceCycles = [1,1,1,5,1,1]; 1516} 1517def: InstRW<[SKLWriteResGroup174], (instregex "RCL(8|16|32|64)mCL")>; 1518 1519def SKLWriteResGroup177 : SchedWriteRes<[SKLPort4,SKLPort23,SKLPort237,SKLPort06,SKLPort15,SKLPort0156]> { 1520 let Latency = 16; 1521 let NumMicroOps = 14; 1522 let ResourceCycles = [1,1,1,4,2,5]; 1523} 1524def: InstRW<[SKLWriteResGroup177], (instrs CMPXCHG8B)>; 1525 1526def SKLWriteResGroup178 : SchedWriteRes<[SKLPort0156]> { 1527 let Latency = 16; 1528 let NumMicroOps = 16; 1529 let ResourceCycles = [16]; 1530} 1531def: InstRW<[SKLWriteResGroup178], (instrs VZEROALL)>; 1532 1533def SKLWriteResGroup179 : SchedWriteRes<[SKLPort0,SKLPort23,SKLFPDivider]> { 1534 let Latency = 17; 1535 let NumMicroOps = 2; 1536 let ResourceCycles = [1,1,5]; 1537} 1538def : SchedAlias<WriteFDivXLd, SKLWriteResGroup179>; // TODO - convert to ZnWriteResFpuPair 1539 1540def SKLWriteResGroup180 : SchedWriteRes<[SKLPort0,SKLPort1,SKLPort5,SKLPort6,SKLPort05,SKLPort0156]> { 1541 let Latency = 17; 1542 let NumMicroOps = 15; 1543 let ResourceCycles = [2,1,2,4,2,4]; 1544} 1545def: InstRW<[SKLWriteResGroup180], (instrs XCH_F)>; 1546 1547def SKLWriteResGroup184 : SchedWriteRes<[SKLPort5,SKLPort6,SKLPort06,SKLPort0156]> { 1548 let Latency = 18; 1549 let NumMicroOps = 8; 1550 let ResourceCycles = [1,1,1,5]; 1551} 1552def: InstRW<[SKLWriteResGroup184], (instrs CPUID, RDTSC)>; 1553 1554def SKLWriteResGroup185 : SchedWriteRes<[SKLPort1,SKLPort23,SKLPort237,SKLPort06,SKLPort15,SKLPort0156]> { 1555 let Latency = 18; 1556 let NumMicroOps = 11; 1557 let ResourceCycles = [2,1,1,4,1,2]; 1558} 1559def: InstRW<[SKLWriteResGroup185], (instregex "RCR(8|16|32|64)mCL")>; 1560 1561def SKLWriteResGroup186 : SchedWriteRes<[SKLPort0,SKLPort23,SKLFPDivider]> { 1562 let Latency = 19; 1563 let NumMicroOps = 2; 1564 let ResourceCycles = [1,1,4]; 1565} 1566def : SchedAlias<WriteFDiv64Ld, SKLWriteResGroup186>; // TODO - convert to ZnWriteResFpuPair 1567 1568def SKLWriteResGroup189 : SchedWriteRes<[SKLPort0]> { 1569 let Latency = 20; 1570 let NumMicroOps = 1; 1571 let ResourceCycles = [1]; 1572} 1573def: InstRW<[SKLWriteResGroup189], (instregex "DIV_(FPrST0|FST0r|FrST0)")>; 1574 1575def SKLWriteResGroup190 : SchedWriteRes<[SKLPort0,SKLPort23,SKLFPDivider]> { 1576 let Latency = 20; 1577 let NumMicroOps = 2; 1578 let ResourceCycles = [1,1,4]; 1579} 1580def : SchedAlias<WriteFDiv64XLd, SKLWriteResGroup190>; // TODO - convert to ZnWriteResFpuPair 1581 1582def SKLWriteResGroup192 : SchedWriteRes<[SKLPort4,SKLPort5,SKLPort6,SKLPort23,SKLPort237,SKLPort06,SKLPort0156]> { 1583 let Latency = 20; 1584 let NumMicroOps = 8; 1585 let ResourceCycles = [1,1,1,1,1,1,2]; 1586} 1587def: InstRW<[SKLWriteResGroup192], (instrs INSB, INSL, INSW)>; 1588 1589def SKLWriteResGroup193 : SchedWriteRes<[SKLPort5,SKLPort6,SKLPort0156]> { 1590 let Latency = 20; 1591 let NumMicroOps = 10; 1592 let ResourceCycles = [1,2,7]; 1593} 1594def: InstRW<[SKLWriteResGroup193], (instrs MWAITrr)>; 1595 1596def SKLWriteResGroup195 : SchedWriteRes<[SKLPort0,SKLPort23,SKLFPDivider]> { 1597 let Latency = 21; 1598 let NumMicroOps = 2; 1599 let ResourceCycles = [1,1,8]; 1600} 1601def : SchedAlias<WriteFDiv64YLd, SKLWriteResGroup195>; // TODO - convert to ZnWriteResFpuPair 1602 1603def SKLWriteResGroup196 : SchedWriteRes<[SKLPort0,SKLPort23]> { 1604 let Latency = 22; 1605 let NumMicroOps = 2; 1606 let ResourceCycles = [1,1]; 1607} 1608def: InstRW<[SKLWriteResGroup196], (instregex "DIV_F(32|64)m")>; 1609 1610def SKLWriteResGroupVEX2 : SchedWriteRes<[SKLPort0, SKLPort23, SKLPort5, SKLPort015]> { 1611 let Latency = 18; 1612 let NumMicroOps = 5; // 2 uops perform multiple loads 1613 let ResourceCycles = [1,2,1,1]; 1614} 1615def: InstRW<[SKLWriteResGroupVEX2], (instrs VGATHERDPDrm, VPGATHERDQrm, 1616 VGATHERQPDrm, VPGATHERQQrm, 1617 VGATHERQPSrm, VPGATHERQDrm)>; 1618 1619def SKLWriteResGroupVEX4 : SchedWriteRes<[SKLPort0, SKLPort23, SKLPort5, SKLPort015]> { 1620 let Latency = 20; 1621 let NumMicroOps = 5; // 2 uops peform multiple loads 1622 let ResourceCycles = [1,4,1,1]; 1623} 1624def: InstRW<[SKLWriteResGroupVEX4], (instrs VGATHERDPDYrm, VPGATHERDQYrm, 1625 VGATHERDPSrm, VPGATHERDDrm, 1626 VGATHERQPDYrm, VPGATHERQQYrm, 1627 VGATHERQPSYrm, VPGATHERQDYrm)>; 1628 1629def SKLWriteResGroupVEX8 : SchedWriteRes<[SKLPort0, SKLPort23, SKLPort5, SKLPort015]> { 1630 let Latency = 22; 1631 let NumMicroOps = 5; // 2 uops perform multiple loads 1632 let ResourceCycles = [1,8,1,1]; 1633} 1634def: InstRW<[SKLWriteResGroupVEX8], (instrs VGATHERDPSYrm, VPGATHERDDYrm)>; 1635 1636def SKLWriteResGroup198 : SchedWriteRes<[SKLPort0,SKLPort4,SKLPort5,SKLPort23,SKLPort237,SKLPort06,SKLPort0156]> { 1637 let Latency = 23; 1638 let NumMicroOps = 19; 1639 let ResourceCycles = [2,1,4,1,1,4,6]; 1640} 1641def: InstRW<[SKLWriteResGroup198], (instrs CMPXCHG16B)>; 1642 1643def SKLWriteResGroup202 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23]> { 1644 let Latency = 25; 1645 let NumMicroOps = 3; 1646 let ResourceCycles = [1,1,1]; 1647} 1648def: InstRW<[SKLWriteResGroup202], (instregex "DIV_FI(16|32)m")>; 1649 1650def SKLWriteResGroup206 : SchedWriteRes<[SKLPort0,SKLPort23]> { 1651 let Latency = 27; 1652 let NumMicroOps = 2; 1653 let ResourceCycles = [1,1]; 1654} 1655def: InstRW<[SKLWriteResGroup206], (instregex "DIVR_F(32|64)m")>; 1656 1657def SKLWriteResGroup208 : SchedWriteRes<[SKLPort0,SKLPort5,SKLPort23]> { 1658 let Latency = 30; 1659 let NumMicroOps = 3; 1660 let ResourceCycles = [1,1,1]; 1661} 1662def: InstRW<[SKLWriteResGroup208], (instregex "DIVR_FI(16|32)m")>; 1663 1664def SKLWriteResGroup209 : SchedWriteRes<[SKLPort5,SKLPort6,SKLPort23,SKLPort06,SKLPort0156]> { 1665 let Latency = 35; 1666 let NumMicroOps = 23; 1667 let ResourceCycles = [1,5,3,4,10]; 1668} 1669def: InstRW<[SKLWriteResGroup209], (instregex "IN(8|16|32)ri", 1670 "IN(8|16|32)rr")>; 1671 1672def SKLWriteResGroup210 : SchedWriteRes<[SKLPort5,SKLPort6,SKLPort23,SKLPort237,SKLPort06,SKLPort0156]> { 1673 let Latency = 35; 1674 let NumMicroOps = 23; 1675 let ResourceCycles = [1,5,2,1,4,10]; 1676} 1677def: InstRW<[SKLWriteResGroup210], (instregex "OUT(8|16|32)ir", 1678 "OUT(8|16|32)rr")>; 1679 1680def SKLWriteResGroup211 : SchedWriteRes<[SKLPort1,SKLPort6,SKLPort23,SKLPort0156]> { 1681 let Latency = 37; 1682 let NumMicroOps = 31; 1683 let ResourceCycles = [1,8,1,21]; 1684} 1685def: InstRW<[SKLWriteResGroup211], (instregex "XRSTOR(64)?")>; 1686 1687def SKLWriteResGroup212 : SchedWriteRes<[SKLPort1,SKLPort4,SKLPort5,SKLPort6,SKLPort23,SKLPort237,SKLPort15,SKLPort0156]> { 1688 let Latency = 40; 1689 let NumMicroOps = 18; 1690 let ResourceCycles = [1,1,2,3,1,1,1,8]; 1691} 1692def: InstRW<[SKLWriteResGroup212], (instrs VMCLEARm)>; 1693 1694def SKLWriteResGroup213 : SchedWriteRes<[SKLPort4,SKLPort6,SKLPort23,SKLPort237,SKLPort0156]> { 1695 let Latency = 41; 1696 let NumMicroOps = 39; 1697 let ResourceCycles = [1,10,1,1,26]; 1698} 1699def: InstRW<[SKLWriteResGroup213], (instrs XSAVE64)>; 1700 1701def SKLWriteResGroup214 : SchedWriteRes<[SKLPort5,SKLPort0156]> { 1702 let Latency = 42; 1703 let NumMicroOps = 22; 1704 let ResourceCycles = [2,20]; 1705} 1706def: InstRW<[SKLWriteResGroup214], (instrs RDTSCP)>; 1707 1708def SKLWriteResGroup215 : SchedWriteRes<[SKLPort4,SKLPort6,SKLPort23,SKLPort237,SKLPort0156]> { 1709 let Latency = 42; 1710 let NumMicroOps = 40; 1711 let ResourceCycles = [1,11,1,1,26]; 1712} 1713def: InstRW<[SKLWriteResGroup215], (instrs XSAVE)>; 1714def: InstRW<[SKLWriteResGroup215], (instregex "XSAVEC", "XSAVES")>; 1715 1716def SKLWriteResGroup216 : SchedWriteRes<[SKLPort4,SKLPort6,SKLPort23,SKLPort237,SKLPort0156]> { 1717 let Latency = 46; 1718 let NumMicroOps = 44; 1719 let ResourceCycles = [1,11,1,1,30]; 1720} 1721def: InstRW<[SKLWriteResGroup216], (instregex "XSAVEOPT")>; 1722 1723def SKLWriteResGroup217 : SchedWriteRes<[SKLPort0,SKLPort23,SKLPort05,SKLPort06,SKLPort0156]> { 1724 let Latency = 62; 1725 let NumMicroOps = 64; 1726 let ResourceCycles = [2,8,5,10,39]; 1727} 1728def: InstRW<[SKLWriteResGroup217], (instrs FLDENVm)>; 1729 1730def SKLWriteResGroup218 : SchedWriteRes<[SKLPort0,SKLPort6,SKLPort23,SKLPort05,SKLPort06,SKLPort15,SKLPort0156]> { 1731 let Latency = 63; 1732 let NumMicroOps = 88; 1733 let ResourceCycles = [4,4,31,1,2,1,45]; 1734} 1735def: InstRW<[SKLWriteResGroup218], (instrs FXRSTOR64)>; 1736 1737def SKLWriteResGroup219 : SchedWriteRes<[SKLPort0,SKLPort6,SKLPort23,SKLPort05,SKLPort06,SKLPort15,SKLPort0156]> { 1738 let Latency = 63; 1739 let NumMicroOps = 90; 1740 let ResourceCycles = [4,2,33,1,2,1,47]; 1741} 1742def: InstRW<[SKLWriteResGroup219], (instrs FXRSTOR)>; 1743 1744def SKLWriteResGroup220 : SchedWriteRes<[SKLPort5,SKLPort05,SKLPort0156]> { 1745 let Latency = 75; 1746 let NumMicroOps = 15; 1747 let ResourceCycles = [6,3,6]; 1748} 1749def: InstRW<[SKLWriteResGroup220], (instrs FNINIT)>; 1750 1751def SKLWriteResGroup223 : SchedWriteRes<[SKLPort0,SKLPort1,SKLPort4,SKLPort5,SKLPort6,SKLPort237,SKLPort06,SKLPort0156]> { 1752 let Latency = 106; 1753 let NumMicroOps = 100; 1754 let ResourceCycles = [9,1,11,16,1,11,21,30]; 1755} 1756def: InstRW<[SKLWriteResGroup223], (instrs FSTENVm)>; 1757 1758def: InstRW<[WriteZero], (instrs CLC)>; 1759 1760 1761// Instruction variants handled by the renamer. These might not need execution 1762// ports in certain conditions. 1763// See Agner's Fog "The microarchitecture of Intel, AMD and VIA CPUs", 1764// section "Skylake Pipeline" > "Register allocation and renaming". 1765// These can be investigated with llvm-exegesis, e.g. 1766// echo 'pxor %mm0, %mm0' | /tmp/llvm-exegesis -mode=uops -snippets-file=- 1767// echo 'vxorpd %xmm0, %xmm0, %xmm1' | /tmp/llvm-exegesis -mode=uops -snippets-file=- 1768 1769def SKLWriteZeroLatency : SchedWriteRes<[]> { 1770 let Latency = 0; 1771} 1772 1773def SKLWriteZeroIdiom : SchedWriteVariant<[ 1774 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1775 SchedVar<NoSchedPred, [WriteALU]> 1776]>; 1777def : InstRW<[SKLWriteZeroIdiom], (instrs SUB32rr, SUB64rr, 1778 XOR32rr, XOR64rr)>; 1779 1780def SKLWriteFZeroIdiom : SchedWriteVariant<[ 1781 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1782 SchedVar<NoSchedPred, [WriteFLogic]> 1783]>; 1784def : InstRW<[SKLWriteFZeroIdiom], (instrs XORPSrr, VXORPSrr, XORPDrr, 1785 VXORPDrr)>; 1786 1787def SKLWriteFZeroIdiomY : SchedWriteVariant<[ 1788 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1789 SchedVar<NoSchedPred, [WriteFLogicY]> 1790]>; 1791def : InstRW<[SKLWriteFZeroIdiomY], (instrs VXORPSYrr, VXORPDYrr)>; 1792 1793def SKLWriteVZeroIdiomLogicX : SchedWriteVariant<[ 1794 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1795 SchedVar<NoSchedPred, [WriteVecLogicX]> 1796]>; 1797def : InstRW<[SKLWriteVZeroIdiomLogicX], (instrs PXORrr, VPXORrr)>; 1798 1799def SKLWriteVZeroIdiomLogicY : SchedWriteVariant<[ 1800 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1801 SchedVar<NoSchedPred, [WriteVecLogicY]> 1802]>; 1803def : InstRW<[SKLWriteVZeroIdiomLogicY], (instrs VPXORYrr)>; 1804 1805def SKLWriteVZeroIdiomALUX : SchedWriteVariant<[ 1806 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1807 SchedVar<NoSchedPred, [WriteVecALUX]> 1808]>; 1809def : InstRW<[SKLWriteVZeroIdiomALUX], (instrs PCMPGTBrr, VPCMPGTBrr, 1810 PCMPGTDrr, VPCMPGTDrr, 1811 PCMPGTWrr, VPCMPGTWrr)>; 1812 1813def SKLWriteVZeroIdiomALUY : SchedWriteVariant<[ 1814 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1815 SchedVar<NoSchedPred, [WriteVecALUY]> 1816]>; 1817def : InstRW<[SKLWriteVZeroIdiomALUY], (instrs VPCMPGTBYrr, 1818 VPCMPGTDYrr, 1819 VPCMPGTWYrr)>; 1820 1821def SKLWritePSUB : SchedWriteRes<[SKLPort015]> { 1822 let Latency = 1; 1823 let NumMicroOps = 1; 1824 let ResourceCycles = [1]; 1825} 1826 1827def SKLWriteVZeroIdiomPSUB : SchedWriteVariant<[ 1828 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1829 SchedVar<NoSchedPred, [SKLWritePSUB]> 1830]>; 1831def : InstRW<[SKLWriteVZeroIdiomPSUB], (instrs PSUBBrr, VPSUBBrr, 1832 PSUBDrr, VPSUBDrr, 1833 PSUBQrr, VPSUBQrr, 1834 PSUBWrr, VPSUBWrr, 1835 VPSUBBYrr, 1836 VPSUBDYrr, 1837 VPSUBQYrr, 1838 VPSUBWYrr)>; 1839 1840def SKLWritePCMPGTQ : SchedWriteRes<[SKLPort5]> { 1841 let Latency = 3; 1842 let NumMicroOps = 1; 1843 let ResourceCycles = [1]; 1844} 1845 1846def SKLWriteVZeroIdiomPCMPGTQ : SchedWriteVariant<[ 1847 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKLWriteZeroLatency]>, 1848 SchedVar<NoSchedPred, [SKLWritePCMPGTQ]> 1849]>; 1850def : InstRW<[SKLWriteVZeroIdiomPCMPGTQ], (instrs PCMPGTQrr, VPCMPGTQrr, 1851 VPCMPGTQYrr)>; 1852 1853 1854// CMOVs that use both Z and C flag require an extra uop. 1855def SKLWriteCMOVA_CMOVBErr : SchedWriteRes<[SKLPort06]> { 1856 let Latency = 2; 1857 let ResourceCycles = [2]; 1858 let NumMicroOps = 2; 1859} 1860 1861def SKLWriteCMOVA_CMOVBErm : SchedWriteRes<[SKLPort23,SKLPort06]> { 1862 let Latency = 7; 1863 let ResourceCycles = [1,2]; 1864 let NumMicroOps = 3; 1865} 1866 1867def SKLCMOVA_CMOVBErr : SchedWriteVariant<[ 1868 SchedVar<MCSchedPredicate<IsCMOVArr_Or_CMOVBErr>, [SKLWriteCMOVA_CMOVBErr]>, 1869 SchedVar<NoSchedPred, [WriteCMOV]> 1870]>; 1871 1872def SKLCMOVA_CMOVBErm : SchedWriteVariant<[ 1873 SchedVar<MCSchedPredicate<IsCMOVArm_Or_CMOVBErm>, [SKLWriteCMOVA_CMOVBErm]>, 1874 SchedVar<NoSchedPred, [WriteCMOV.Folded]> 1875]>; 1876 1877def : InstRW<[SKLCMOVA_CMOVBErr], (instrs CMOV16rr, CMOV32rr, CMOV64rr)>; 1878def : InstRW<[SKLCMOVA_CMOVBErm], (instrs CMOV16rm, CMOV32rm, CMOV64rm)>; 1879 1880// SETCCs that use both Z and C flag require an extra uop. 1881def SKLWriteSETA_SETBEr : SchedWriteRes<[SKLPort06]> { 1882 let Latency = 2; 1883 let ResourceCycles = [2]; 1884 let NumMicroOps = 2; 1885} 1886 1887def SKLWriteSETA_SETBEm : SchedWriteRes<[SKLPort4,SKLPort237,SKLPort06]> { 1888 let Latency = 3; 1889 let ResourceCycles = [1,1,2]; 1890 let NumMicroOps = 4; 1891} 1892 1893def SKLSETA_SETBErr : SchedWriteVariant<[ 1894 SchedVar<MCSchedPredicate<IsSETAr_Or_SETBEr>, [SKLWriteSETA_SETBEr]>, 1895 SchedVar<NoSchedPred, [WriteSETCC]> 1896]>; 1897 1898def SKLSETA_SETBErm : SchedWriteVariant<[ 1899 SchedVar<MCSchedPredicate<IsSETAm_Or_SETBEm>, [SKLWriteSETA_SETBEm]>, 1900 SchedVar<NoSchedPred, [WriteSETCCStore]> 1901]>; 1902 1903def : InstRW<[SKLSETA_SETBErr], (instrs SETCCr)>; 1904def : InstRW<[SKLSETA_SETBErm], (instrs SETCCm)>; 1905 1906/////////////////////////////////////////////////////////////////////////////// 1907// Dependency breaking instructions. 1908/////////////////////////////////////////////////////////////////////////////// 1909 1910def : IsZeroIdiomFunction<[ 1911 // GPR Zero-idioms. 1912 DepBreakingClass<[ SUB32rr, SUB64rr, XOR32rr, XOR64rr ], ZeroIdiomPredicate>, 1913 1914 // SSE Zero-idioms. 1915 DepBreakingClass<[ 1916 // fp variants. 1917 XORPSrr, XORPDrr, 1918 1919 // int variants. 1920 PXORrr, 1921 PSUBBrr, PSUBWrr, PSUBDrr, PSUBQrr, 1922 PCMPGTBrr, PCMPGTDrr, PCMPGTQrr, PCMPGTWrr 1923 ], ZeroIdiomPredicate>, 1924 1925 // AVX Zero-idioms. 1926 DepBreakingClass<[ 1927 // xmm fp variants. 1928 VXORPSrr, VXORPDrr, 1929 1930 // xmm int variants. 1931 VPXORrr, 1932 VPSUBBrr, VPSUBWrr, VPSUBDrr, VPSUBQrr, 1933 VPCMPGTBrr, VPCMPGTWrr, VPCMPGTDrr, VPCMPGTQrr, 1934 1935 // ymm variants. 1936 VXORPSYrr, VXORPDYrr, VPXORYrr, 1937 VPSUBBYrr, VPSUBWYrr, VPSUBDYrr, VPSUBQYrr, 1938 VPCMPGTBYrr, VPCMPGTWYrr, VPCMPGTDYrr, VPCMPGTQYrr 1939 ], ZeroIdiomPredicate>, 1940]>; 1941 1942} // SchedModel 1943