2014-09-10 04:07:07 +08:00
|
|
|
//=- X86ScheduleBtVer2.td - X86 BtVer2 (Jaguar) Scheduling ---*- tablegen -*-=//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the machine model for AMD btver2 (Jaguar) to support
|
|
|
|
// instruction scheduling and other instruction cost heuristics. Based off AMD Software
|
|
|
|
// Optimization Guide for AMD Family 16h Processors & Instruction Latency appendix.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def BtVer2Model : SchedMachineModel {
|
|
|
|
// All x86 instructions are modeled as a single micro-op, and btver2 can
|
|
|
|
// decode 2 instructions per cycle.
|
|
|
|
let IssueWidth = 2;
|
|
|
|
let MicroOpBufferSize = 64; // Retire Control Unit
|
|
|
|
let LoadLatency = 5; // FPU latency (worse case cf Integer 3 cycle latency)
|
|
|
|
let HighLatency = 25;
|
|
|
|
let MispredictPenalty = 14; // Minimum branch misdirection penalty
|
|
|
|
let PostRAScheduler = 1;
|
2017-12-13 00:12:53 +08:00
|
|
|
|
|
|
|
// FIXME: SSE4/AVX is unimplemented. This flag is set to allow
|
|
|
|
// the scheduler to assign a default model to unrecognized opcodes.
|
|
|
|
let CompleteModel = 0;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
let SchedModel = BtVer2Model in {
|
|
|
|
|
|
|
|
// Jaguar can issue up to 6 micro-ops in one cycle
|
|
|
|
def JALU0 : ProcResource<1>; // Integer Pipe0: integer ALU0 (also handle FP->INT jam)
|
|
|
|
def JALU1 : ProcResource<1>; // Integer Pipe1: integer ALU1/MUL/DIV
|
|
|
|
def JLAGU : ProcResource<1>; // Integer Pipe2: LAGU
|
|
|
|
def JSAGU : ProcResource<1>; // Integer Pipe3: SAGU (also handles 3-operand LEA)
|
|
|
|
def JFPU0 : ProcResource<1>; // Vector/FPU Pipe0: VALU0/VIMUL/FPA
|
|
|
|
def JFPU1 : ProcResource<1>; // Vector/FPU Pipe1: VALU1/STC/FPM
|
|
|
|
|
|
|
|
// Any pipe - FIXME we need this until we can discriminate between int/fpu load/store/moves properly
|
|
|
|
def JAny : ProcResGroup<[JALU0, JALU1, JLAGU, JSAGU, JFPU0, JFPU1]>;
|
|
|
|
|
|
|
|
// Integer Pipe Scheduler
|
|
|
|
def JALU01 : ProcResGroup<[JALU0, JALU1]> {
|
|
|
|
let BufferSize=20;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AGU Pipe Scheduler
|
|
|
|
def JLSAGU : ProcResGroup<[JLAGU, JSAGU]> {
|
|
|
|
let BufferSize=12;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fpu Pipe Scheduler
|
|
|
|
def JFPU01 : ProcResGroup<[JFPU0, JFPU1]> {
|
|
|
|
let BufferSize=18;
|
|
|
|
}
|
|
|
|
|
|
|
|
def JDiv : ProcResource<1>; // integer division
|
|
|
|
def JMul : ProcResource<1>; // integer multiplication
|
|
|
|
def JVALU0 : ProcResource<1>; // vector integer
|
|
|
|
def JVALU1 : ProcResource<1>; // vector integer
|
|
|
|
def JVIMUL : ProcResource<1>; // vector integer multiplication
|
|
|
|
def JSTC : ProcResource<1>; // vector store/convert
|
|
|
|
def JFPM : ProcResource<1>; // FP multiplication
|
|
|
|
def JFPA : ProcResource<1>; // FP addition
|
|
|
|
|
|
|
|
// Integer loads are 3 cycles, so ReadAfterLd registers needn't be available until 3
|
|
|
|
// cycles after the memory operand.
|
|
|
|
def : ReadAdvance<ReadAfterLd, 3>;
|
|
|
|
|
|
|
|
// Many SchedWrites are defined in pairs with and without a folded load.
|
|
|
|
// Instructions with folded loads are usually micro-fused, so they only appear
|
|
|
|
// as two micro-ops when dispatched by the schedulers.
|
|
|
|
// This multiclass defines the resource usage for variants with and without
|
|
|
|
// folded loads.
|
|
|
|
multiclass JWriteResIntPair<X86FoldableSchedWrite SchedRW,
|
2018-03-13 00:02:56 +08:00
|
|
|
ProcResourceKind ExePort,
|
2018-03-15 05:55:54 +08:00
|
|
|
int Lat, int Res = 1, int UOps = 1> {
|
2014-09-10 04:07:07 +08:00
|
|
|
// Register variant is using a single cycle on ExePort.
|
2018-03-15 05:55:54 +08:00
|
|
|
def : WriteRes<SchedRW, [ExePort]> {
|
|
|
|
let Latency = Lat;
|
|
|
|
let ResourceCycles = [Res];
|
|
|
|
let NumMicroOps = UOps;
|
|
|
|
}
|
2014-09-10 04:07:07 +08:00
|
|
|
|
|
|
|
// Memory variant also uses a cycle on JLAGU and adds 3 cycles to the
|
|
|
|
// latency.
|
|
|
|
def : WriteRes<SchedRW.Folded, [JLAGU, ExePort]> {
|
2018-03-13 05:35:12 +08:00
|
|
|
let Latency = !add(Lat, 3);
|
2018-03-15 05:55:54 +08:00
|
|
|
let ResourceCycles = [1, Res];
|
|
|
|
let NumMicroOps = UOps;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
multiclass JWriteResFpuPair<X86FoldableSchedWrite SchedRW,
|
2018-03-13 00:02:56 +08:00
|
|
|
ProcResourceKind ExePort,
|
|
|
|
int Lat, int Res = 1, int UOps = 1> {
|
2014-09-10 04:07:07 +08:00
|
|
|
// Register variant is using a single cycle on ExePort.
|
2018-03-13 00:02:56 +08:00
|
|
|
def : WriteRes<SchedRW, [ExePort]> {
|
|
|
|
let Latency = Lat;
|
|
|
|
let ResourceCycles = [Res];
|
|
|
|
let NumMicroOps = UOps;
|
|
|
|
}
|
2014-09-10 04:07:07 +08:00
|
|
|
|
|
|
|
// Memory variant also uses a cycle on JLAGU and adds 5 cycles to the
|
|
|
|
// latency.
|
|
|
|
def : WriteRes<SchedRW.Folded, [JLAGU, ExePort]> {
|
2018-03-13 05:35:12 +08:00
|
|
|
let Latency = !add(Lat, 5);
|
|
|
|
let ResourceCycles = [1, Res];
|
|
|
|
let NumMicroOps = UOps;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// A folded store needs a cycle on the SAGU for the store data.
|
|
|
|
def : WriteRes<WriteRMW, [JSAGU]>;
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Arithmetic.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
defm : JWriteResIntPair<WriteALU, JALU01, 1>;
|
|
|
|
defm : JWriteResIntPair<WriteIMul, JALU1, 3>;
|
|
|
|
|
|
|
|
def : WriteRes<WriteIMulH, [JALU1]> {
|
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [4];
|
|
|
|
}
|
|
|
|
|
2018-03-13 23:22:24 +08:00
|
|
|
// Worst case (i64 division)
|
2014-09-10 04:07:07 +08:00
|
|
|
def : WriteRes<WriteIDiv, [JALU1, JDiv]> {
|
|
|
|
let Latency = 41;
|
2018-03-13 23:22:24 +08:00
|
|
|
let ResourceCycles = [1, 41];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
|
|
|
def : WriteRes<WriteIDivLd, [JLAGU, JALU1, JDiv]> {
|
|
|
|
let Latency = 44;
|
|
|
|
let ResourceCycles = [1, 1, 41];
|
|
|
|
let NumMicroOps = 2;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// This is for simple LEAs with one or two input operands.
|
|
|
|
// FIXME: SAGU 3-operand LEA
|
|
|
|
def : WriteRes<WriteLEA, [JALU01]>;
|
|
|
|
|
2018-03-13 23:22:24 +08:00
|
|
|
def JWriteIDiv8 : SchedWriteRes<[JALU1, JDiv]> {
|
|
|
|
let Latency = 12;
|
|
|
|
let ResourceCycles = [1, 12];
|
|
|
|
}
|
|
|
|
def JWriteIDiv8Ld : SchedWriteRes<[JLAGU, JALU1, JDiv]> {
|
|
|
|
let Latency = 15;
|
|
|
|
let ResourceCycles = [1, 1, 12];
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteIDiv8], (instrs DIV8r, IDIV8r)>;
|
|
|
|
def : InstRW<[JWriteIDiv8Ld], (instrs DIV8m, IDIV8m)>;
|
|
|
|
|
|
|
|
def JWriteIDiv16 : SchedWriteRes<[JALU1, JDiv]> {
|
|
|
|
let Latency = 17;
|
|
|
|
let ResourceCycles = [1, 17];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
|
|
|
def JWriteIDiv16Ld : SchedWriteRes<[JLAGU, JALU1, JDiv]> {
|
|
|
|
let Latency = 20;
|
|
|
|
let ResourceCycles = [1, 1, 17];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteIDiv16], (instrs DIV16r, IDIV16r)>;
|
|
|
|
def : InstRW<[JWriteIDiv16Ld], (instrs DIV16m, IDIV16m)>;
|
|
|
|
|
|
|
|
def JWriteIDiv32 : SchedWriteRes<[JALU1, JDiv]> {
|
|
|
|
let Latency = 25;
|
|
|
|
let ResourceCycles = [1, 25];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
|
|
|
def JWriteIDiv32Ld : SchedWriteRes<[JLAGU, JALU1, JDiv]> {
|
|
|
|
let Latency = 28;
|
|
|
|
let ResourceCycles = [1, 1, 25];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteIDiv32], (instrs DIV32r, IDIV32r)>;
|
|
|
|
def : InstRW<[JWriteIDiv32Ld], (instrs DIV32m, IDIV32m)>;
|
|
|
|
|
2014-09-10 04:07:07 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Integer shifts and rotates.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
defm : JWriteResIntPair<WriteShift, JALU01, 1>;
|
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteSHLDrri : SchedWriteRes<[JALU01]> {
|
2017-11-25 18:46:53 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [6];
|
|
|
|
let NumMicroOps = 6;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def: InstRW<[JWriteSHLDrri], (instrs SHLD16rri8, SHLD32rri8, SHLD64rri8,
|
|
|
|
SHRD16rri8, SHRD32rri8, SHRD64rri8)>;
|
2017-11-25 18:46:53 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteSHLDrrCL : SchedWriteRes<[JALU01]> {
|
2017-11-25 18:46:53 +08:00
|
|
|
let Latency = 4;
|
|
|
|
let ResourceCycles = [8];
|
|
|
|
let NumMicroOps = 7;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def: InstRW<[JWriteSHLDrrCL], (instrs SHLD16rrCL, SHLD32rrCL, SHLD64rrCL,
|
|
|
|
SHRD16rrCL, SHRD32rrCL, SHRD64rrCL)>;
|
2017-11-25 18:46:53 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteSHLDm : SchedWriteRes<[JLAGU, JALU01]> {
|
2017-11-25 18:46:53 +08:00
|
|
|
let Latency = 9;
|
|
|
|
let ResourceCycles = [1, 22];
|
|
|
|
let NumMicroOps = 8;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def: InstRW<[JWriteSHLDm],(instrs SHLD16mri8, SHLD32mri8, SHLD64mri8,
|
|
|
|
SHLD16mrCL, SHLD32mrCL, SHLD64mrCL,
|
|
|
|
SHRD16mri8, SHRD32mri8, SHRD64mri8,
|
|
|
|
SHRD16mrCL, SHRD32mrCL, SHRD64mrCL)>;
|
2017-11-25 18:46:53 +08:00
|
|
|
|
2014-09-10 04:07:07 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Loads, stores, and moves, not folded with other operations.
|
|
|
|
// FIXME: Split x86 and SSE load/store/moves
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
def : WriteRes<WriteLoad, [JLAGU]> { let Latency = 5; }
|
|
|
|
def : WriteRes<WriteStore, [JSAGU]>;
|
2017-12-07 19:19:49 +08:00
|
|
|
def : WriteRes<WriteMove, [JALU01]>;
|
2014-09-10 04:07:07 +08:00
|
|
|
|
2017-12-10 19:51:29 +08:00
|
|
|
// Treat misc copies as a move.
|
|
|
|
def : InstRW<[WriteMove], (instrs COPY)>;
|
|
|
|
|
2014-09-10 04:07:07 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Idioms that clear a register, like xorps %xmm0, %xmm0.
|
|
|
|
// These can often bypass execution ports completely.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
def : WriteRes<WriteZero, []>;
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Branches don't produce values, so they have no latency, but they still
|
|
|
|
// consume resources. Indirect branches can fold loads.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
defm : JWriteResIntPair<WriteJump, JALU01, 1>;
|
|
|
|
|
2018-03-13 05:35:12 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Special case scheduling classes.
|
|
|
|
// FIXME: pipe for system/microcode?
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
def : WriteRes<WriteSystem, [JAny]> { let Latency = 100; }
|
|
|
|
def : WriteRes<WriteMicrocoded, [JAny]> { let Latency = 100; }
|
|
|
|
def : WriteRes<WriteFence, [JSAGU]>;
|
|
|
|
def : WriteRes<WriteNop, []>;
|
|
|
|
|
2014-09-10 04:07:07 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Floating point. This covers both scalar and vector operations.
|
|
|
|
// FIXME: should we bother splitting JFPU pipe + unit stages for fast instructions?
|
|
|
|
// FIXME: Double precision latencies
|
|
|
|
// FIXME: SS vs PS latencies
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-09-26 20:56:44 +08:00
|
|
|
defm : JWriteResFpuPair<WriteFAdd, JFPU0, 3>;
|
|
|
|
defm : JWriteResFpuPair<WriteFMul, JFPU1, 2>;
|
2017-11-27 18:41:32 +08:00
|
|
|
defm : JWriteResFpuPair<WriteFMA, JFPU1, 2>; // NOTE: Doesn't exist on Jaguar.
|
2014-09-26 20:56:44 +08:00
|
|
|
defm : JWriteResFpuPair<WriteFRcp, JFPU1, 2>;
|
|
|
|
defm : JWriteResFpuPair<WriteFRsqrt, JFPU1, 2>;
|
|
|
|
defm : JWriteResFpuPair<WriteFShuffle, JFPU01, 1>;
|
|
|
|
defm : JWriteResFpuPair<WriteFBlend, JFPU01, 1>;
|
2018-03-13 00:02:56 +08:00
|
|
|
defm : JWriteResFpuPair<WriteFVarBlend, JFPU01, 2, 4, 3>;
|
2014-09-10 04:07:07 +08:00
|
|
|
defm : JWriteResFpuPair<WriteFShuffle256, JFPU01, 1>;
|
|
|
|
|
2018-03-13 02:12:46 +08:00
|
|
|
def : WriteRes<WriteFSqrt, [JFPU1, JFPM]> {
|
2014-09-10 04:07:07 +08:00
|
|
|
let Latency = 21;
|
2018-03-13 02:12:46 +08:00
|
|
|
let ResourceCycles = [1, 21];
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
def : WriteRes<WriteFSqrtLd, [JFPU1, JLAGU, JFPM]> {
|
|
|
|
let Latency = 26;
|
|
|
|
let ResourceCycles = [1, 1, 21];
|
|
|
|
}
|
|
|
|
|
2018-03-13 02:12:46 +08:00
|
|
|
def : WriteRes<WriteFDiv, [JFPU1, JFPM]> {
|
2014-09-10 04:07:07 +08:00
|
|
|
let Latency = 19;
|
2018-03-13 02:12:46 +08:00
|
|
|
let ResourceCycles = [1, 19];
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
def : WriteRes<WriteFDivLd, [JFPU1, JLAGU, JFPM]> {
|
|
|
|
let Latency = 24;
|
|
|
|
let ResourceCycles = [1, 1, 19];
|
|
|
|
}
|
|
|
|
|
2018-03-13 05:35:12 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Conversions.
|
2014-09-10 04:07:07 +08:00
|
|
|
// FIXME: integer pipes
|
2018-03-13 05:35:12 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-09-10 04:07:07 +08:00
|
|
|
defm : JWriteResFpuPair<WriteCvtF2I, JFPU1, 3>; // Float -> Integer.
|
|
|
|
defm : JWriteResFpuPair<WriteCvtI2F, JFPU1, 3>; // Integer -> Float.
|
|
|
|
defm : JWriteResFpuPair<WriteCvtF2F, JFPU1, 3>; // Float -> Float size conversion.
|
|
|
|
|
2018-03-13 00:02:56 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2014-09-10 04:07:07 +08:00
|
|
|
// Vector integer operations.
|
2018-03-13 00:02:56 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2014-09-10 04:07:07 +08:00
|
|
|
|
2018-03-13 00:02:56 +08:00
|
|
|
defm : JWriteResFpuPair<WriteVecALU, JFPU01, 1>;
|
|
|
|
defm : JWriteResFpuPair<WriteVecShift, JFPU01, 1>;
|
|
|
|
defm : JWriteResFpuPair<WriteVecIMul, JFPU0, 2>;
|
|
|
|
defm : JWriteResFpuPair<WriteMPSAD, JFPU0, 3, 2>;
|
|
|
|
defm : JWriteResFpuPair<WriteShuffle, JFPU01, 1>;
|
|
|
|
defm : JWriteResFpuPair<WriteBlend, JFPU01, 1>;
|
|
|
|
defm : JWriteResFpuPair<WriteVarBlend, JFPU01, 2, 4, 3>;
|
|
|
|
defm : JWriteResFpuPair<WriteVecLogic, JFPU01, 1>;
|
|
|
|
defm : JWriteResFpuPair<WriteShuffle256, JFPU01, 1>;
|
|
|
|
defm : JWriteResFpuPair<WriteVarVecShift, JFPU01, 1>; // NOTE: Doesn't exist on Jaguar.
|
2014-09-10 04:07:07 +08:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// String instructions.
|
|
|
|
// Packed Compare Implicit Length Strings, Return Mask
|
|
|
|
// FIXME: approximate latencies + pipe dependencies
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-11-27 17:58:00 +08:00
|
|
|
def : WriteRes<WritePCmpIStrM, [JFPU1,JFPU0]> {
|
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [2, 2];
|
|
|
|
let NumMicroOps = 3;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
2017-11-27 17:58:00 +08:00
|
|
|
def : WriteRes<WritePCmpIStrMLd, [JLAGU, JFPU1, JFPU0]> {
|
|
|
|
let Latency = 13;
|
|
|
|
let ResourceCycles = [1, 2, 2];
|
|
|
|
let NumMicroOps = 3;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Packed Compare Explicit Length Strings, Return Mask
|
2017-11-27 17:58:00 +08:00
|
|
|
def : WriteRes<WritePCmpEStrM, [JFPU1, JLAGU, JFPU01,JFPU1, JFPU0]> {
|
|
|
|
let Latency = 14;
|
|
|
|
let ResourceCycles = [5, 5, 5, 5, 5];
|
|
|
|
let NumMicroOps = 9;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
2017-11-27 17:58:00 +08:00
|
|
|
def : WriteRes<WritePCmpEStrMLd, [JLAGU, JFPU1, JLAGU, JFPU01,JFPU1, JFPU0]> {
|
|
|
|
let Latency = 19;
|
|
|
|
let ResourceCycles = [1, 5, 5, 5, 5, 5];
|
|
|
|
let NumMicroOps = 9;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Packed Compare Implicit Length Strings, Return Index
|
2017-11-27 17:58:00 +08:00
|
|
|
def : WriteRes<WritePCmpIStrI, [JFPU1, JFPU0]> {
|
|
|
|
let Latency = 7;
|
|
|
|
let ResourceCycles = [2, 2];
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
2017-11-27 17:58:00 +08:00
|
|
|
def : WriteRes<WritePCmpIStrILd, [JLAGU, JFPU1, JFPU0]> {
|
|
|
|
let Latency = 12;
|
|
|
|
let ResourceCycles = [1, 2, 2];
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Packed Compare Explicit Length Strings, Return Index
|
2017-11-27 17:58:00 +08:00
|
|
|
def : WriteRes<WritePCmpEStrI, [JFPU1, JLAGU, JFPU01,JFPU1, JFPU0]> {
|
|
|
|
let Latency = 14;
|
|
|
|
let ResourceCycles = [5, 5, 5, 5, 5];
|
|
|
|
let NumMicroOps = 9;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
2017-11-27 17:58:00 +08:00
|
|
|
def : WriteRes<WritePCmpEStrILd, [JLAGU, JFPU1, JLAGU, JFPU01,JFPU1, JFPU0]> {
|
|
|
|
let Latency = 19;
|
|
|
|
let ResourceCycles = [1, 5, 5, 5, 5, 5];
|
|
|
|
let NumMicroOps = 9;
|
2014-09-10 04:07:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// AES Instructions.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-03-12 23:29:00 +08:00
|
|
|
defm : JWriteResFpuPair<WriteAESIMC, JVIMUL, 2>;
|
|
|
|
defm : JWriteResFpuPair<WriteAESKeyGen, JVIMUL, 2>;
|
|
|
|
defm : JWriteResFpuPair<WriteAESDecEnc, JVIMUL, 3>;
|
2014-09-10 04:07:07 +08:00
|
|
|
|
2017-06-09 00:44:13 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Horizontal add/sub instructions.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-03-12 23:29:00 +08:00
|
|
|
defm : JWriteResFpuPair<WriteFHAdd, JFPU0, 3>;
|
|
|
|
defm : JWriteResFpuPair<WritePHAdd, JFPU01, 1>;
|
2017-06-09 00:44:13 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFHAddY: SchedWriteRes<[JFPU0]> {
|
2017-06-09 00:44:13 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFHAddY], (instrs VHADDPDYrr, VHADDPSYrr, VHSUBPDYrr, VHSUBPSYrr)>;
|
2017-06-09 00:44:13 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFHAddYLd: SchedWriteRes<[JLAGU, JFPU0]> {
|
2017-06-09 00:44:13 +08:00
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFHAddYLd], (instrs VHADDPDYrm, VHADDPSYrm, VHSUBPDYrm, VHSUBPSYrm)>;
|
2017-06-09 00:44:13 +08:00
|
|
|
|
2014-09-10 04:07:07 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Carry-less multiplication instructions.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-03-12 23:29:00 +08:00
|
|
|
defm : JWriteResFpuPair<WriteCLMul, JVIMUL, 2>;
|
2014-09-10 04:07:07 +08:00
|
|
|
|
2017-10-23 23:53:30 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// SSE4.1 instructions.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteDPPS: SchedWriteRes<[JFPU0, JFPU1]> {
|
2017-10-23 23:53:30 +08:00
|
|
|
let Latency = 11;
|
|
|
|
let ResourceCycles = [3,3];
|
|
|
|
let NumMicroOps = 5;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteDPPS], (instrs DPPSrri, VDPPSrri)>;
|
2017-10-23 23:53:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteDPPSLd: SchedWriteRes<[JLAGU, JFPU0, JFPU1]> {
|
2017-10-23 23:53:30 +08:00
|
|
|
let Latency = 16;
|
|
|
|
let ResourceCycles = [1,3,3];
|
|
|
|
let NumMicroOps = 6;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteDPPSLd], (instrs DPPSrmi, VDPPSrmi)>;
|
2017-10-23 23:53:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteDPPD: SchedWriteRes<[JFPU0, JFPU1]> {
|
2017-10-23 23:53:30 +08:00
|
|
|
let Latency = 9;
|
|
|
|
let ResourceCycles = [3,3];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteDPPD], (instrs DPPDrri, VDPPDrri)>;
|
2017-10-23 23:53:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteDPPDLd: SchedWriteRes<[JLAGU, JFPU0, JFPU1]> {
|
2017-10-23 23:53:30 +08:00
|
|
|
let Latency = 14;
|
|
|
|
let ResourceCycles = [1,3,3];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteDPPDLd], (instrs DPPDrmi, VDPPDrmi)>;
|
2017-10-23 23:53:30 +08:00
|
|
|
|
2017-07-16 20:06:06 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// SSE4A instructions.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteEXTRQ: SchedWriteRes<[JFPU01]> {
|
2017-07-16 20:06:06 +08:00
|
|
|
let Latency = 1;
|
|
|
|
let ResourceCycles = [1];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteEXTRQ], (instrs EXTRQ, EXTRQI)>;
|
2017-07-16 20:06:06 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteINSERTQ: SchedWriteRes<[JFPU01]> {
|
2017-07-16 20:06:06 +08:00
|
|
|
let Latency = 2;
|
|
|
|
let ResourceCycles = [4];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteINSERTQ], (instrs INSERTQ, INSERTQI)>;
|
2017-07-16 20:06:06 +08:00
|
|
|
|
2017-10-24 21:38:30 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// F16C instructions.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteCVT3: SchedWriteRes<[JFPU1]> {
|
2017-10-24 21:38:30 +08:00
|
|
|
let Latency = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteCVT3], (instrs VCVTPS2PHrr, VCVTPH2PSrr)>;
|
2017-10-24 21:38:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteCVT3St: SchedWriteRes<[JFPU1, JSAGU]> {
|
2017-10-24 21:38:30 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [1, 1];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteCVT3St], (instrs VCVTPS2PHmr)>;
|
2017-10-24 21:38:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteCVT3Ld: SchedWriteRes<[JLAGU, JFPU1]> {
|
2017-10-24 21:38:30 +08:00
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [1, 1];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteCVT3Ld], (instrs VCVTPH2PSrm)>;
|
2017-10-24 21:38:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteCVTPS2PHY: SchedWriteRes<[JFPU1, JFPU01]> {
|
2017-10-24 21:38:30 +08:00
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [2,2];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteCVTPS2PHY], (instrs VCVTPS2PHYrr)>;
|
2017-10-24 21:38:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteCVTPS2PHYSt: SchedWriteRes<[JFPU1, JFPU01, JSAGU]> {
|
2017-10-24 21:38:30 +08:00
|
|
|
let Latency = 11;
|
|
|
|
let ResourceCycles = [2,2,1];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteCVTPS2PHYSt], (instrs VCVTPS2PHYmr)>;
|
2017-10-24 21:38:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteCVTPH2PSY: SchedWriteRes<[JFPU1]> {
|
2017-10-24 21:38:30 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteCVTPH2PSY], (instrs VCVTPH2PSYrr)>;
|
2017-10-24 21:38:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteCVTPH2PSYLd: SchedWriteRes<[JLAGU, JFPU1]> {
|
2017-10-24 21:38:30 +08:00
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [1,2];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteCVTPH2PSYLd], (instrs VCVTPH2PSYrm)>;
|
2017-10-24 21:38:30 +08:00
|
|
|
|
2017-07-11 00:36:03 +08:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// AVX instructions.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteLogicY: SchedWriteRes<[JFPU01]> {
|
2018-03-03 02:20:35 +08:00
|
|
|
let Latency = 1;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteLogicY], (instrs VORPDYrr, VORPSYrr,
|
|
|
|
VXORPDYrr, VXORPSYrr,
|
|
|
|
VANDPDYrr, VANDPSYrr,
|
|
|
|
VANDNPDYrr, VANDNPSYrr)>;
|
2018-03-03 02:20:35 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteLogicYLd: SchedWriteRes<[JLAGU, JFPU01]> {
|
2018-03-03 02:20:35 +08:00
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteLogicYLd], (instrs VORPDYrm, VORPSYrm,
|
|
|
|
VXORPDYrm, VXORPSYrm,
|
|
|
|
VANDPDYrm, VANDPSYrm,
|
|
|
|
VANDNPDYrm, VANDNPSYrm)>;
|
2018-03-03 02:20:35 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVDPPSY: SchedWriteRes<[JFPU1, JFPU0]> {
|
2017-10-23 23:53:30 +08:00
|
|
|
let Latency = 12;
|
|
|
|
let ResourceCycles = [6, 6];
|
|
|
|
let NumMicroOps = 10;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVDPPSY], (instrs VDPPSYrri)>;
|
2017-10-23 23:53:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVDPPSYLd: SchedWriteRes<[JLAGU, JFPU1, JFPU0]> {
|
2017-10-23 23:53:30 +08:00
|
|
|
let Latency = 17;
|
|
|
|
let ResourceCycles = [1, 6, 6];
|
|
|
|
let NumMicroOps = 11;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVDPPSYLd, ReadAfterLd], (instrs VDPPSYrmi)>;
|
2017-10-23 23:53:30 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFAddY: SchedWriteRes<[JFPU0]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFAddY], (instrs VADDPDYrr, VADDPSYrr,
|
|
|
|
VSUBPDYrr, VSUBPSYrr,
|
|
|
|
VADDSUBPDYrr, VADDSUBPSYrr)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFAddYLd: SchedWriteRes<[JLAGU, JFPU0]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFAddYLd, ReadAfterLd], (instrs VADDPDYrm, VADDPSYrm,
|
|
|
|
VSUBPDYrm, VSUBPSYrm,
|
|
|
|
VADDSUBPDYrm, VADDSUBPSYrm)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFDivY: SchedWriteRes<[JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 38;
|
|
|
|
let ResourceCycles = [38];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFDivY], (instrs VDIVPDYrr, VDIVPSYrr)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFDivYLd: SchedWriteRes<[JLAGU, JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 43;
|
|
|
|
let ResourceCycles = [1, 38];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFDivYLd, ReadAfterLd], (instrs VDIVPDYrm, VDIVPSYrm)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMULYPD: SchedWriteRes<[JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 4;
|
|
|
|
let ResourceCycles = [4];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMULYPD], (instrs VMULPDYrr)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMULYPDLd: SchedWriteRes<[JLAGU, JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 9;
|
|
|
|
let ResourceCycles = [1, 4];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMULYPDLd, ReadAfterLd], (instrs VMULPDYrm)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMULYPS: SchedWriteRes<[JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 2;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMULYPS], (instrs VMULPSYrr, VRCPPSYr, VRSQRTPSYr)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMULYPSLd: SchedWriteRes<[JLAGU, JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 7;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMULYPSLd, ReadAfterLd], (instrs VMULPSYrm, VRCPPSYm, VRSQRTPSYm)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMULPD: SchedWriteRes<[JFPU1]> {
|
2018-01-15 22:21:11 +08:00
|
|
|
let Latency = 4;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMULPD], (instrs MULPDrr, MULSDrr, VMULPDrr, VMULSDrr)>;
|
2018-01-15 22:21:11 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMULPDLd: SchedWriteRes<[JLAGU, JFPU1]> {
|
2018-01-15 22:21:11 +08:00
|
|
|
let Latency = 9;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMULPDLd], (instrs MULPDrm, MULSDrm, VMULPDrm, VMULSDrm)>;
|
2018-01-15 22:21:11 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVCVTY: SchedWriteRes<[JSTC]> {
|
2017-11-02 00:10:20 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVCVTY], (instrs VCVTDQ2PDYrr, VCVTDQ2PSYrr,
|
|
|
|
VCVTPS2DQYrr, VCVTTPS2DQYrr,
|
|
|
|
VROUNDYPDr, VROUNDYPSr)>;
|
2017-11-02 00:10:20 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVCVTYLd: SchedWriteRes<[JLAGU, JSTC]> {
|
2017-11-02 00:10:20 +08:00
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVCVTYLd, ReadAfterLd], (instrs VCVTDQ2PDYrm, VCVTDQ2PSYrm,
|
|
|
|
VCVTPS2DQYrm, VCVTTPS2DQYrm,
|
|
|
|
VROUNDYPDm, VROUNDYPSm)>;
|
2017-11-02 00:10:20 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMOVNTDQSt: SchedWriteRes<[JSTC, JSAGU]> {
|
2018-01-15 22:21:11 +08:00
|
|
|
let Latency = 2;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMOVNTDQSt], (instrs MOVNTDQmr, VMOVNTDQmr)>;
|
2018-01-15 22:21:11 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteMOVNTSt: SchedWriteRes<[JSTC, JSAGU]> {
|
2018-01-15 22:21:11 +08:00
|
|
|
let Latency = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteMOVNTSt], (instrs MOVNTPDmr, MOVNTPSmr, MOVNTSD, MOVNTSS, VMOVNTPDmr, VMOVNTPSmr)>;
|
2018-01-15 22:21:11 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMOVNTPYSt: SchedWriteRes<[JSTC, JSAGU]> {
|
2017-11-02 00:10:20 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [2,1];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMOVNTPYSt], (instrs VMOVNTDQYmr, VMOVNTPDYmr, VMOVNTPSYmr)>;
|
2018-01-15 22:21:11 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFCmp: SchedWriteRes<[JFPU0]> {
|
2018-01-15 22:21:11 +08:00
|
|
|
let Latency = 2;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFCmp], (instregex "(V)?M(AX|IN)(P|S)(D|S)rr",
|
|
|
|
"(V)?CMPP(S|D)rri", "(V)?CMPS(S|D)rr")>;
|
2018-01-15 22:21:11 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFCmpLd: SchedWriteRes<[JLAGU, JFPU0]> {
|
2018-01-15 22:21:11 +08:00
|
|
|
let Latency = 7;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFCmpLd], (instregex "(V)?M(AX|IN)(P|S)(D|S)rm",
|
|
|
|
"(V)?CMPP(S|D)rmi", "(V)?CMPS(S|D)rm")>;
|
2017-11-02 00:10:20 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVCVTPDY: SchedWriteRes<[JSTC, JFPU01]> {
|
2017-11-02 00:10:20 +08:00
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [2, 4];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVCVTPDY], (instrs VCVTPD2DQYrr, VCVTTPD2DQYrr, VCVTPD2PSYrr)>;
|
2017-11-02 00:10:20 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVCVTPDYLd: SchedWriteRes<[JLAGU, JSTC, JFPU01]> {
|
2017-11-02 00:10:20 +08:00
|
|
|
let Latency = 11;
|
|
|
|
let ResourceCycles = [1, 2, 4];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVCVTPDYLd, ReadAfterLd], (instrs VCVTPD2DQYrm, VCVTTPD2DQYrm, VCVTPD2PSYrm)>;
|
2017-11-02 00:10:20 +08:00
|
|
|
|
2018-03-14 22:05:19 +08:00
|
|
|
def JWritePSHUFB: SchedWriteRes<[JFPU01]> {
|
|
|
|
let Latency = 2;
|
|
|
|
let ResourceCycles = [4];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWritePSHUFB], (instrs PSHUFBrr, VPSHUFBrr)>;
|
|
|
|
|
|
|
|
def JWritePSHUFBLd: SchedWriteRes<[JLAGU, JFPU01]> {
|
|
|
|
let Latency = 7;
|
|
|
|
let ResourceCycles = [1, 4];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWritePSHUFBLd, ReadAfterLd], (instrs PSHUFBrm, VPSHUFBrm)>;
|
|
|
|
|
|
|
|
def JWriteVPERM: SchedWriteRes<[JFPU01]> {
|
|
|
|
let Latency = 2;
|
|
|
|
let ResourceCycles = [4];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteVPERM], (instrs VPERMILPDrr, VPERMILPSrr)>;
|
|
|
|
|
|
|
|
def JWriteVPERMLd: SchedWriteRes<[JLAGU, JFPU01]> {
|
|
|
|
let Latency = 7;
|
|
|
|
let ResourceCycles = [1, 4];
|
|
|
|
let NumMicroOps = 3;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteVPERMLd, ReadAfterLd], (instrs VPERMILPDrm, VPERMILPSrm)>;
|
|
|
|
|
|
|
|
def JWriteVPERMY: SchedWriteRes<[JFPU01]> {
|
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [6];
|
|
|
|
let NumMicroOps = 6;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteVPERMY], (instrs VPERMILPDYrr, VPERMILPSYrr)>;
|
|
|
|
|
|
|
|
def JWriteVPERMYLd: SchedWriteRes<[JLAGU, JFPU01]> {
|
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [1, 6];
|
|
|
|
let NumMicroOps = 6;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteVPERMYLd, ReadAfterLd], (instrs VPERMILPDYrm, VPERMILPSYrm)>;
|
|
|
|
|
|
|
|
def JWriteShuffleY: SchedWriteRes<[JFPU01]> {
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteShuffleY], (instrs VMOVDDUPYrr, VMOVSHDUPYrr, VMOVSLDUPYrr,
|
|
|
|
VPERMILPDYri, VPERMILPSYri, VSHUFPDYrri, VSHUFPSYrri)>;
|
|
|
|
|
|
|
|
def JWriteShuffleYLd: SchedWriteRes<[JLAGU, JFPU01]> {
|
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
let NumMicroOps = 2;
|
|
|
|
}
|
|
|
|
def : InstRW<[JWriteShuffleYLd, ReadAfterLd], (instrs VMOVDDUPYrm, VMOVSHDUPYrm, VMOVSLDUPYrm,
|
|
|
|
VPERMILPDYmi, VPERMILPSYmi, VSHUFPDYrmi, VSHUFPSYrmi)>;
|
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVBlendVPY: SchedWriteRes<[JFPU01]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [6];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVBlendVPY], (instrs VBLENDVPDYrr, VBLENDVPSYrr, VPERMILPDYrr, VPERMILPSYrr)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVBlendVPYLd: SchedWriteRes<[JLAGU, JFPU01]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [1, 6];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVBlendVPYLd, ReadAfterLd], (instrs VBLENDVPDYrm, VBLENDVPSYrm)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVBROADCASTYLd: SchedWriteRes<[JLAGU, JFPU01]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [1, 4];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVBROADCASTYLd, ReadAfterLd], (instrs VBROADCASTSDYrm, VBROADCASTSSYrm)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFPAY22: SchedWriteRes<[JFPU0]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 2;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFPAY22], (instregex "VCMPP(S|D)Yrri", "VM(AX|IN)P(D|S)Yrr")>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteFPAY22Ld: SchedWriteRes<[JLAGU, JFPU0]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 7;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteFPAY22Ld, ReadAfterLd], (instregex "VCMPP(S|D)Yrmi", "VM(AX|IN)P(D|S)Yrm")>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVHAddSubY: SchedWriteRes<[JFPU0]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 3;
|
|
|
|
let ResourceCycles = [2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVHAddSubY], (instrs VHADDPDYrr, VHADDPSYrr, VHSUBPDYrr, VHSUBPSYrr)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVHAddSubYLd: SchedWriteRes<[JLAGU, JFPU0]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 8;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVHAddSubYLd], (instrs VHADDPDYrm, VHADDPSYrm, VHSUBPDYrm, VHSUBPSYrm)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMaskMovLd: SchedWriteRes<[JLAGU,JFPU01]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [1, 2];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMaskMovLd], (instrs VMASKMOVPDrm, VMASKMOVPSrm)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMaskMovYLd: SchedWriteRes<[JLAGU,JFPU01]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [1, 4];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMaskMovYLd], (instrs VMASKMOVPDYrm, VMASKMOVPSYrm)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMaskMovSt: SchedWriteRes<[JFPU01,JSAGU]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [4, 1];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMaskMovSt], (instrs VMASKMOVPDmr, VMASKMOVPSmr)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMaskMovYSt: SchedWriteRes<[JFPU01,JSAGU]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 6;
|
|
|
|
let ResourceCycles = [4, 1];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMaskMovYSt], (instrs VMASKMOVPDYmr, VMASKMOVPSYmr)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
|
|
|
// TODO: In fact we have latency '2+i'. The +i represents an additional 1 cycle transfer
|
|
|
|
// operation which moves the floating point result to the integer unit. During this
|
|
|
|
// additional cycle the floating point unit execution resources are not occupied
|
|
|
|
// and ALU0 in the integer unit is occupied instead.
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVMOVMSK: SchedWriteRes<[JFPU0]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVMOVMSK], (instrs VMOVMSKPDrr, VMOVMSKPDYrr, VMOVMSKPSrr, VMOVMSKPSYrr)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
|
|
|
// TODO: In fact we have latency '3+i'. The +i represents an additional 1 cycle transfer
|
|
|
|
// operation which moves the floating point result to the integer unit. During this
|
|
|
|
// additional cycle the floating point unit execution resources are not occupied
|
|
|
|
// and ALU0 in the integer unit is occupied instead.
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVTESTY: SchedWriteRes<[JFPU01, JFPU0]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 4;
|
2017-11-09 22:19:59 +08:00
|
|
|
let ResourceCycles = [2, 2];
|
|
|
|
let NumMicroOps = 3;
|
2017-11-02 18:33:41 +08:00
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVTESTY], (instrs VPTESTYrr, VTESTPDYrr, VTESTPSYrr)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVTESTYLd: SchedWriteRes<[JLAGU, JFPU01, JFPU0]> {
|
2017-11-02 18:33:41 +08:00
|
|
|
let Latency = 9;
|
2017-11-09 22:19:59 +08:00
|
|
|
let ResourceCycles = [1, 2, 2];
|
|
|
|
let NumMicroOps = 3;
|
2017-11-02 18:33:41 +08:00
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVTESTYLd], (instrs VPTESTYrm, VTESTPDYrm, VTESTPSYrm)>;
|
2017-11-02 18:33:41 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVTEST: SchedWriteRes<[JFPU0]> {
|
2017-11-09 22:19:59 +08:00
|
|
|
let Latency = 3;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVTEST], (instrs PTESTrr, VPTESTrr, VTESTPDrr, VTESTPSrr)>;
|
2017-11-09 22:19:59 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVTESTLd: SchedWriteRes<[JLAGU, JFPU0]> {
|
2017-11-09 22:19:59 +08:00
|
|
|
let Latency = 8;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVTESTLd], (instrs PTESTrm, VPTESTrm, VTESTPDrm, VTESTPSrm)>;
|
2017-11-09 22:19:59 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVSQRTYPD: SchedWriteRes<[JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 54;
|
|
|
|
let ResourceCycles = [54];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVSQRTYPD], (instrs VSQRTPDYr)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVSQRTYPDLd: SchedWriteRes<[JLAGU, JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 59;
|
|
|
|
let ResourceCycles = [1, 54];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVSQRTYPDLd], (instrs VSQRTPDYm)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVSQRTYPS: SchedWriteRes<[JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 42;
|
|
|
|
let ResourceCycles = [42];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVSQRTYPS], (instrs VSQRTPSYr)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteVSQRTYPSLd: SchedWriteRes<[JLAGU, JFPU1]> {
|
2017-07-11 00:36:03 +08:00
|
|
|
let Latency = 47;
|
|
|
|
let ResourceCycles = [1, 42];
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteVSQRTYPSLd], (instrs VSQRTPSYm)>;
|
2017-07-11 00:36:03 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteJVZEROALL: SchedWriteRes<[]> {
|
2017-07-27 21:12:08 +08:00
|
|
|
let Latency = 90;
|
|
|
|
let NumMicroOps = 73;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteJVZEROALL], (instrs VZEROALL)>;
|
2017-07-27 21:12:08 +08:00
|
|
|
|
2018-03-13 01:07:08 +08:00
|
|
|
def JWriteJVZEROUPPER: SchedWriteRes<[]> {
|
2017-07-27 21:12:08 +08:00
|
|
|
let Latency = 46;
|
|
|
|
let NumMicroOps = 37;
|
|
|
|
}
|
2018-03-13 01:07:08 +08:00
|
|
|
def : InstRW<[JWriteJVZEROUPPER], (instrs VZEROUPPER)>;
|
2014-09-10 04:07:07 +08:00
|
|
|
} // SchedModel
|
|
|
|
|