annotate lib/Target/X86/X86ScheduleZnver1.td @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //=- X86ScheduleZnver1.td - X86 Znver1 Scheduling -------------*- tablegen -*-=//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 // This file defines the machine model for Znver1 to support instruction
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 // scheduling and other instruction cost heuristics.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 def Znver1Model : SchedMachineModel {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 // Zen can decode 4 instructions per cycle.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 let IssueWidth = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 // Based on the reorder buffer we define MicroOpBufferSize
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 let MicroOpBufferSize = 192;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 let LoadLatency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 let MispredictPenalty = 17;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 let HighLatency = 25;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 let PostRAScheduler = 1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 // FIXME: This variable is required for incomplete model.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 // We haven't catered all instructions.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 // So, we reset the value of this variable so as to
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 // say that the model is incomplete.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 let CompleteModel = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 let SchedModel = Znver1Model in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 // Zen can issue micro-ops to 10 different units in one cycle.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 // These are
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 // * Four integer ALU units (ZALU0, ZALU1, ZALU2, ZALU3)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 // * Two AGU units (ZAGU0, ZAGU1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 // * Four FPU units (ZFPU0, ZFPU1, ZFPU2, ZFPU3)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 // AGUs feed load store queues @two loads and 1 store per cycle.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 // Four ALU units are defined below
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 def ZnALU0 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 def ZnALU1 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 def ZnALU2 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 def ZnALU3 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 // Two AGU units are defined below
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 def ZnAGU0 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 def ZnAGU1 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 // Four FPU units are defined below
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 def ZnFPU0 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 def ZnFPU1 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 def ZnFPU2 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 def ZnFPU3 : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 // FPU grouping
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 def ZnFPU : ProcResGroup<[ZnFPU0, ZnFPU1, ZnFPU2, ZnFPU3]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 def ZnFPU013 : ProcResGroup<[ZnFPU0, ZnFPU1, ZnFPU3]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 def ZnFPU01 : ProcResGroup<[ZnFPU0, ZnFPU1]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 def ZnFPU12 : ProcResGroup<[ZnFPU1, ZnFPU2]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 def ZnFPU13 : ProcResGroup<[ZnFPU1, ZnFPU3]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 def ZnFPU23 : ProcResGroup<[ZnFPU2, ZnFPU3]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 def ZnFPU02 : ProcResGroup<[ZnFPU0, ZnFPU2]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 def ZnFPU03 : ProcResGroup<[ZnFPU0, ZnFPU3]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 // Below are the grouping of the units.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 // Micro-ops to be issued to multiple units are tackled this way.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 // ALU grouping
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 // ZnALU03 - 0,3 grouping
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 def ZnALU03: ProcResGroup<[ZnALU0, ZnALU3]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 // 56 Entry (14x4 entries) Int Scheduler
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 def ZnALU : ProcResGroup<[ZnALU0, ZnALU1, ZnALU2, ZnALU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 let BufferSize=56;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 // 28 Entry (14x2) AGU group. AGUs can't be used for all ALU operations
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 // but are relevant for some instructions
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 def ZnAGU : ProcResGroup<[ZnAGU0, ZnAGU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 let BufferSize=28;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 // Integer Multiplication issued on ALU1.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 def ZnMultiplier : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 // Integer division issued on ALU2.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 def ZnDivider : ProcResource<1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 // 4 Cycles load-to use Latency is captured
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 def : ReadAdvance<ReadAfterLd, 4>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 // (a folded load is an instruction that loads and does some operation)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 // Ex: ADDPD xmm,[mem]-> This instruction has two micro-ops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 // Instructions with folded loads are usually micro-fused, so they only appear
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 // as two micro-ops.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 // a. load and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 // b. addpd
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 // This multiclass is for folded loads for integer units.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 multiclass ZnWriteResPair<X86FoldableSchedWrite SchedRW,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 ProcResourceKind ExePort,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 int Lat> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 // Register variant takes 1-cycle on Execution Port.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 def : WriteRes<SchedRW, [ExePort]> { let Latency = Lat; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 // Memory variant also uses a cycle on ZnAGU
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 // adds 4 cycles to the latency.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 def : WriteRes<SchedRW.Folded, [ZnAGU, ExePort]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 let Latency = !add(Lat, 4);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 // This multiclass is for folded loads for floating point units.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 multiclass ZnWriteResFpuPair<X86FoldableSchedWrite SchedRW,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117 ProcResourceKind ExePort,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 int Lat> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 // Register variant takes 1-cycle on Execution Port.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 def : WriteRes<SchedRW, [ExePort]> { let Latency = Lat; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 // Memory variant also uses a cycle on ZnAGU
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 // adds 7 cycles to the latency.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124 def : WriteRes<SchedRW.Folded, [ZnAGU, ExePort]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 let Latency = !add(Lat, 7);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 // WriteRMW is set for instructions with Memory write
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130 // operation in codegen
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 def : WriteRes<WriteRMW, [ZnAGU]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 def : WriteRes<WriteStore, [ZnAGU]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
134 def : WriteRes<WriteMove, [ZnALU]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135 def : WriteRes<WriteLoad, [ZnAGU]> { let Latency = 8; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137 def : WriteRes<WriteZero, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138 def : WriteRes<WriteLEA, [ZnALU]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139 defm : ZnWriteResPair<WriteALU, ZnALU, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 defm : ZnWriteResPair<WriteShift, ZnALU, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141 defm : ZnWriteResPair<WriteJump, ZnALU, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 // IDIV
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 def : WriteRes<WriteIDiv, [ZnALU2, ZnDivider]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145 let Latency = 41;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 let ResourceCycles = [1, 41];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 def : WriteRes<WriteIDivLd, [ZnALU2, ZnAGU, ZnDivider]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150 let Latency = 45;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 let ResourceCycles = [1, 4, 41];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154 // IMUL
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
155 def : WriteRes<WriteIMulH, [ZnALU1, ZnMultiplier]>{
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
158 def : WriteRes<WriteIMul, [ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
159 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
160 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
161
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
162 def : WriteRes<WriteIMulLd,[ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
163 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
164 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
165
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
166 // Floating point operations
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
167 defm : ZnWriteResFpuPair<WriteFHAdd, ZnFPU0, 3>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
168 defm : ZnWriteResFpuPair<WriteFAdd, ZnFPU0, 3>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
169 defm : ZnWriteResFpuPair<WriteFBlend, ZnFPU01, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
170 defm : ZnWriteResFpuPair<WriteFVarBlend, ZnFPU01, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
171 defm : ZnWriteResFpuPair<WriteVarBlend, ZnFPU0, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
172 defm : ZnWriteResFpuPair<WriteCvtI2F, ZnFPU3, 5>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
173 defm : ZnWriteResFpuPair<WriteCvtF2F, ZnFPU3, 5>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
174 defm : ZnWriteResFpuPair<WriteCvtF2I, ZnFPU3, 5>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
175 defm : ZnWriteResFpuPair<WriteFDiv, ZnFPU3, 15>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
176 defm : ZnWriteResFpuPair<WriteFShuffle, ZnFPU12, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
177 defm : ZnWriteResFpuPair<WriteFMul, ZnFPU0, 5>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
178 defm : ZnWriteResFpuPair<WriteFRcp, ZnFPU01, 5>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
179 defm : ZnWriteResFpuPair<WriteFRsqrt, ZnFPU01, 5>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
180 defm : ZnWriteResFpuPair<WriteFSqrt, ZnFPU3, 20>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
181
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
182 // Vector integer operations which uses FPU units
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
183 defm : ZnWriteResFpuPair<WriteVecShift, ZnFPU, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
184 defm : ZnWriteResFpuPair<WriteVecLogic, ZnFPU, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
185 defm : ZnWriteResFpuPair<WritePHAdd, ZnFPU, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
186 defm : ZnWriteResFpuPair<WriteVecALU, ZnFPU, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
187 defm : ZnWriteResFpuPair<WriteVecIMul, ZnFPU0, 4>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
188 defm : ZnWriteResFpuPair<WriteShuffle, ZnFPU, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
189 defm : ZnWriteResFpuPair<WriteBlend, ZnFPU01, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
190 defm : ZnWriteResFpuPair<WriteShuffle256, ZnFPU, 2>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
191
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
192 // Vector Shift Operations
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
193 defm : ZnWriteResFpuPair<WriteVarVecShift, ZnFPU12, 1>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
194
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
195 // AES Instructions.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
196 defm : ZnWriteResFpuPair<WriteAESDecEnc, ZnFPU01, 4>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
197 defm : ZnWriteResFpuPair<WriteAESIMC, ZnFPU01, 4>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
198 defm : ZnWriteResFpuPair<WriteAESKeyGen, ZnFPU01, 4>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
199
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
200 def : WriteRes<WriteFence, [ZnAGU]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
201 def : WriteRes<WriteNop, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
202
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
203 // Following instructions with latency=100 are microcoded.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
204 // We set long latency so as to block the entire pipeline.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
205 defm : ZnWriteResFpuPair<WriteFShuffle256, ZnFPU, 100>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
206
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
207 //Microcoded Instructions
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
208 let Latency = 100 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
209 def : WriteRes<WriteMicrocoded, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
210 def : WriteRes<WriteSystem, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
211 def : WriteRes<WriteMPSAD, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
212 def : WriteRes<WriteMPSADLd, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
213 def : WriteRes<WriteCLMul, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
214 def : WriteRes<WriteCLMulLd, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
215 def : WriteRes<WritePCmpIStrM, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
216 def : WriteRes<WritePCmpIStrMLd, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
217 def : WriteRes<WritePCmpEStrI, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
218 def : WriteRes<WritePCmpEStrILd, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
219 def : WriteRes<WritePCmpEStrM, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
220 def : WriteRes<WritePCmpEStrMLd, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
221 def : WriteRes<WritePCmpIStrI, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
222 def : WriteRes<WritePCmpIStrILd, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
223 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
224
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
225 //=== Regex based itineraries ===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
226 // Notation:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
227 // - r: register.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
228 // - m = memory.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
229 // - i = immediate
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
230 // - mm: 64 bit mmx register.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
231 // - x = 128 bit xmm register.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
232 // - (x)mm = mmx or xmm register.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
233 // - y = 256 bit ymm register.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
234 // - v = any vector register.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
235
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
236 //=== Integer Instructions ===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
237 //-- Move instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
238 // MOV.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
239 // r16,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
240 def : InstRW<[WriteALULd, ReadAfterLd], (instregex "MOV16rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
241
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
242 // MOVSX, MOVZX.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
243 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
244 def : InstRW<[WriteLoad], (instregex "MOV(S|Z)X32rm(8|16)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
245
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
246 // CMOVcc.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
247 // r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
248 def : InstRW<[WriteALU],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
249 (instregex "CMOV(O|NO|B|AE|E|NE|BE|A|S|NS|P|NP|L|GE|LE|G)(16|32|64)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
250 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
251 def : InstRW<[WriteALULd, ReadAfterLd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
252 (instregex "CMOV(O|NO|B|AE|E|NE|BE|A|S|NS|P|NP|L|GE|LE|G)(16|32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
253
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
254 // XCHG.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
255 // r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
256 def ZnWriteXCHG : SchedWriteRes<[ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
257 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
258 let ResourceCycles = [2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
259 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
260
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
261 def : InstRW<[ZnWriteXCHG], (instregex "XCHG(8|16|32|64)rr", "XCHG(16|32|64)ar")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
262
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
263 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
264 def ZnWriteXCHGrm : SchedWriteRes<[ZnAGU, ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
265 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
266 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
267 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
268 def : InstRW<[ZnWriteXCHGrm, ReadAfterLd], (instregex "XCHG(8|16|32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
269
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
270 def : InstRW<[WriteMicrocoded], (instregex "XLAT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
271
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
272 // POP16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
273 // r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
274 def ZnWritePop16r : SchedWriteRes<[ZnAGU]>{
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
275 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
276 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
277 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
278 def : InstRW<[ZnWritePop16r], (instregex "POP16rmm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
279 def : InstRW<[WriteMicrocoded], (instregex "POPF(16|32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
280 def : InstRW<[WriteMicrocoded], (instregex "POPA(16|32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
281
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
282
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
283 // PUSH.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
284 // r. Has default values.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
285 // m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
286 def ZnWritePUSH : SchedWriteRes<[ZnAGU]>{
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
287 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
288 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
289 def : InstRW<[ZnWritePUSH], (instregex "PUSH(16|32)rmm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
290
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
291 //PUSHF
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
292 def : InstRW<[WriteMicrocoded], (instregex "PUSHF(16|32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
293
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
294 // PUSHA.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
295 def ZnWritePushA : SchedWriteRes<[ZnAGU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
296 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
297 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
298 def : InstRW<[ZnWritePushA], (instregex "PUSHA(16|32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
299
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
300 //LAHF
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
301 def : InstRW<[WriteMicrocoded], (instregex "LAHF")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
302
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
303 // SAHF.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
304 def ZnWriteSAHF : SchedWriteRes<[ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
305 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
306 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
307 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
308 def : InstRW<[ZnWriteSAHF], (instregex "SAHF")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
309
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
310 // BSWAP.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
311 def ZnWriteBSwap : SchedWriteRes<[ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
312 let ResourceCycles = [4];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
313 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
314 def : InstRW<[ZnWriteBSwap], (instregex "BSWAP")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
315
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
316 // MOVBE.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
317 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
318 def ZnWriteMOVBE : SchedWriteRes<[ZnAGU, ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
319 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
320 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
321 def : InstRW<[ZnWriteMOVBE, ReadAfterLd], (instregex "MOVBE(16|32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
322
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
323 // m16,r16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
324 def : InstRW<[ZnWriteMOVBE], (instregex "MOVBE(16|32|64)mr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
325
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
326 //-- Arithmetic instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
327
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
328 // ADD SUB.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
329 // m,r/i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
330 def : InstRW<[WriteALULd], (instregex "(ADD|SUB)(8|16|32|64)m(r|i)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
331 "(ADD|SUB)(8|16|32|64)mi8",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
332 "(ADD|SUB)64mi32")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
333
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
334 // ADC SBB.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
335 // r,r/i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
336 def : InstRW<[WriteALU], (instregex "(ADC|SBB)(8|16|32|64)r(r|i)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
337 "(ADC|SBB)(16|32|64)ri8",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
338 "(ADC|SBB)64ri32",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
339 "(ADC|SBB)(8|16|32|64)rr_REV")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
340
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
341 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
342 def : InstRW<[WriteALULd, ReadAfterLd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
343 (instregex "(ADC|SBB)(8|16|32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
344
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
345 // m,r/i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
346 def : InstRW<[WriteALULd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
347 (instregex "(ADC|SBB)(8|16|32|64)m(r|i)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
348 "(ADC|SBB)(16|32|64)mi8",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
349 "(ADC|SBB)64mi32")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
350
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
351 // INC DEC NOT NEG.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
352 // m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
353 def : InstRW<[WriteALULd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
354 (instregex "(INC|DEC|NOT|NEG)(8|16|32|64)m",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
355 "(INC|DEC)64(16|32)m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
356
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
357 // MUL IMUL.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
358 // r16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
359 def ZnWriteMul16 : SchedWriteRes<[ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
360 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
361 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
362 def : InstRW<[ZnWriteMul16], (instregex "IMUL16r", "MUL16r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
363
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
364 // m16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
365 def ZnWriteMul16Ld : SchedWriteRes<[ZnAGU, ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
366 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
367 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
368 def : InstRW<[ZnWriteMul16Ld, ReadAfterLd], (instregex "IMUL16m", "MUL16m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
369
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
370 // r32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
371 def ZnWriteMul32 : SchedWriteRes<[ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
372 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
373 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
374 def : InstRW<[ZnWriteMul32], (instregex "IMUL32r", "MUL32r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
375
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
376 // m32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
377 def ZnWriteMul32Ld : SchedWriteRes<[ZnAGU, ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
378 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
379 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
380 def : InstRW<[ZnWriteMul32Ld, ReadAfterLd], (instregex "IMUL32m", "MUL32m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
381
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
382 // r64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
383 def ZnWriteMul64 : SchedWriteRes<[ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
384 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
385 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
386 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
387 def : InstRW<[ZnWriteMul64], (instregex "IMUL64r", "MUL64r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
388
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
389 // m64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
390 def ZnWriteMul64Ld : SchedWriteRes<[ZnAGU, ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
391 let Latency = 9;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
392 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
393 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
394 def : InstRW<[ZnWriteMul64Ld, ReadAfterLd], (instregex "IMUL64m", "MUL64m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
395
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
396 // r16,r16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
397 def ZnWriteMul16rri : SchedWriteRes<[ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
398 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
399 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
400 def : InstRW<[ZnWriteMul16rri], (instregex "IMUL16rri", "IMUL16rri8")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
401
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
402 // r16,m16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
403 def ZnWriteMul16rmi : SchedWriteRes<[ZnAGU, ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
404 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
405 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
406 def : InstRW<[ZnWriteMul16rmi, ReadAfterLd], (instregex "IMUL16rmi", "IMUL16rmi8")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
407
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
408 // MULX.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
409 // r32,r32,r32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
410 def ZnWriteMulX32 : SchedWriteRes<[ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
411 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
412 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
413 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
414 def : InstRW<[ZnWriteMulX32], (instregex "MULX32rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
415
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
416 // r32,r32,m32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
417 def ZnWriteMulX32Ld : SchedWriteRes<[ZnAGU, ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
418 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
419 let ResourceCycles = [1, 2, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
420 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
421 def : InstRW<[ZnWriteMulX32Ld, ReadAfterLd], (instregex "MULX32rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
422
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
423 // r64,r64,r64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
424 def ZnWriteMulX64 : SchedWriteRes<[ZnALU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
425 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
426 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
427 def : InstRW<[ZnWriteMulX64], (instregex "MULX64rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
428
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
429 // r64,r64,m64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
430 def ZnWriteMulX64Ld : SchedWriteRes<[ZnAGU, ZnALU1, ZnMultiplier]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
431 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
432 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
433 def : InstRW<[ZnWriteMulX64Ld, ReadAfterLd], (instregex "MULX64rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
434
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
435 // DIV, IDIV.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
436 // r8.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
437 def ZnWriteDiv8 : SchedWriteRes<[ZnALU2, ZnDivider]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
438 let Latency = 15;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
439 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
440 def : InstRW<[ZnWriteDiv8], (instregex "DIV8r", "IDIV8r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
441
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
442 // r16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
443 def ZnWriteDiv16 : SchedWriteRes<[ZnALU2, ZnDivider]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
444 let Latency = 17;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
445 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
446 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
447 def : InstRW<[ZnWriteDiv16], (instregex "DIV16r", "IDIV16r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
448
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
449 // r32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
450 def ZnWriteDiv32 : SchedWriteRes<[ZnALU2, ZnDivider]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
451 let Latency = 25;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
452 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
453 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
454 def : InstRW<[ZnWriteDiv32], (instregex "DIV32r", "IDIV32r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
455
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
456 // r64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
457 def ZnWriteDiv64 : SchedWriteRes<[ZnALU2, ZnDivider]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
458 let Latency = 41;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
459 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
460 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
461 def : InstRW<[ZnWriteDiv64], (instregex "DIV64r", "IDIV64r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
462
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
463 //-- Control transfer instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
464
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
465 // J(E|R)CXZ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
466 def ZnWriteJCXZ : SchedWriteRes<[ZnALU03]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
467 def : InstRW<[ZnWriteJCXZ], (instregex "JCXZ", "JECXZ_(32|64)", "JRCXZ")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
468
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
469 // INTO
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
470 def : InstRW<[WriteMicrocoded], (instregex "INTO")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
471
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
472 // LOOP.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
473 def ZnWriteLOOP : SchedWriteRes<[ZnALU03]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
474 def : InstRW<[ZnWriteLOOP], (instregex "LOOP")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
475
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
476 // LOOP(N)E, LOOP(N)Z
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
477 def ZnWriteLOOPE : SchedWriteRes<[ZnALU03]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
478 def : InstRW<[ZnWriteLOOPE], (instregex "LOOPE", "LOOPNE",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
479 "LOOPZ", "LOOPNZ")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
480
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
481 // CALL.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
482 // r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
483 def ZnWriteCALLr : SchedWriteRes<[ZnAGU, ZnALU03]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
484 def : InstRW<[ZnWriteCALLr], (instregex "CALL(16|32)r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
485
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
486 def : InstRW<[WriteMicrocoded], (instregex "CALL(16|32)m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
487
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
488 // RET.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
489 def ZnWriteRET : SchedWriteRes<[ZnALU03]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
490 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
491 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
492 def : InstRW<[ZnWriteRET], (instregex "RET(L|Q|W)", "LRET(L|Q|W)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
493 "IRET(D|Q)", "RETF")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
494
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
495 //-- Logic instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
496
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
497 // AND OR XOR.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
498 // m,r/i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
499 def : InstRW<[WriteALULd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
500 (instregex "(AND|OR|XOR)(8|16|32|64)m(r|i)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
501 "(AND|OR|XOR)(8|16|32|64)mi8", "(AND|OR|XOR)64mi32")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
502
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
503 // ANDN.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
504 // r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
505 def : InstRW<[WriteALU], (instregex "ANDN(32|64)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
506 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
507 def : InstRW<[WriteALULd, ReadAfterLd], (instregex "ANDN(32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
508
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
509 // Define ALU latency variants
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
510 def ZnWriteALULat2 : SchedWriteRes<[ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
511 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
512 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
513 def ZnWriteALULat2Ld : SchedWriteRes<[ZnAGU, ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
514 let Latency = 6;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
515 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
516
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
517 def ZnWriteALULat3 : SchedWriteRes<[ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
518 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
519 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
520 def ZnWriteALULat3Ld : SchedWriteRes<[ZnAGU, ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
521 let Latency = 7;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
522 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
523
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
524 // BSF BSR.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
525 // r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
526 def : InstRW<[ZnWriteALULat3], (instregex "BS(R|F)(16|32|64)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
527 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
528 def : InstRW<[ZnWriteALULat3Ld, ReadAfterLd], (instregex "BS(R|F)(16|32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
529
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
530 // BT.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
531 // r,r/i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
532 def : InstRW<[WriteShift], (instregex "BT(16|32|64)r(r|i8)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
533
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
534 def : InstRW<[WriteShiftLd], (instregex "BT(16|32|64)mr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
535 def : InstRW<[WriteShiftLd], (instregex "BT(16|32|64)mi8")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
536
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
537 // BTR BTS BTC.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
538 // r,r,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
539 def ZnWriteBTRSC : SchedWriteRes<[ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
540 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
541 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
542 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
543 def : InstRW<[ZnWriteBTRSC], (instregex "BT(R|S|C)(16|32|64)r(r|i8)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
544
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
545
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
546 // m,r,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
547 def ZnWriteBTRSCm : SchedWriteRes<[ZnAGU, ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
548 let Latency = 6;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
549 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
550 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
551 // m,r,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
552 def : InstRW<[ZnWriteBTRSCm], (instregex "BT(R|S|C)(16|32|64)m(r|i8)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
553
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
554 // BLSI BLSMSK BLSR.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
555 // r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
556 def : InstRW<[ZnWriteALULat2], (instregex "BLS(I|MSK|R)(32|64)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
557 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
558 def : InstRW<[ZnWriteALULat2Ld, ReadAfterLd], (instregex "BLS(I|MSK|R)(32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
559
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
560 // BEXTR.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
561 // r,r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
562 def : InstRW<[WriteALU], (instregex "BEXTR(32|64)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
563 // r,m,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
564 def : InstRW<[WriteALULd, ReadAfterLd], (instregex "BEXTR(32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
565
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
566 // BZHI.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
567 // r,r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
568 def : InstRW<[WriteALU], (instregex "BZHI(32|64)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
569 // r,m,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
570 def : InstRW<[WriteALULd, ReadAfterLd], (instregex "BZHI(32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
571
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
572 // CLD STD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
573 def : InstRW<[WriteALU], (instregex "STD", "CLD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
574
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
575 // PDEP PEXT.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
576 // r,r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
577 def : InstRW<[WriteMicrocoded], (instregex "PDEP(32|64)rr", "PEXT(32|64)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
578 // r,m,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
579 def : InstRW<[WriteMicrocoded], (instregex "PDEP(32|64)rm", "PEXT(32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
580
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
581 // ROR ROL.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
582 def : InstRW<[WriteShift], (instregex "RO(R|L)(8|16|32|64)r1")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
583
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
584 // RCR RCL.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
585 // r,1.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
586 def : InstRW<[WriteShift], (instregex "RC(R|L)(8|16|32|64)r1")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
587
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
588 // m,1.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
589 def : InstRW<[WriteMicrocoded], (instregex "RC(R|L)(8|16|32|64)m1")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
590
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
591 // i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
592 def : InstRW<[WriteShift], (instregex "RC(R|L)(8|16|32|64)r(i|CL)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
593
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
594 // m,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
595 def : InstRW<[WriteMicrocoded], (instregex "RC(R|L)(8|16|32|64)m(i|CL)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
596
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
597 // SHR SHL SAR.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
598 // m,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
599 def : InstRW<[WriteShiftLd], (instregex "S(A|H)(R|L)(8|16|32|64)m(i|1)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
600
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
601 // SHRD SHLD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
602 // r,r
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
603 def : InstRW<[WriteShift], (instregex "SH(R|L)D(16|32|64)rri8")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
604
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
605 // m,r
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
606 def : InstRW<[WriteShiftLd], (instregex "SH(R|L)D(16|32|64)mri8")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
607
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
608 // r,r,cl.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
609 def : InstRW<[WriteMicrocoded], (instregex "SHLD(16|32|64)rrCL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
610
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
611 // r,r,cl.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
612 def : InstRW<[WriteMicrocoded], (instregex "SHRD(16|32|64)rrCL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
613
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
614 // m,r,cl.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
615 def : InstRW<[WriteMicrocoded], (instregex "SH(R|L)D(16|32|64)mrCL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
616
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
617 // SETcc.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
618 // r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
619 def : InstRW<[WriteShift],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
620 (instregex "SET(O|NO|B|AE|E|NE|BE|A|S|NS|P|NP|L|GE|LE|G)r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
621 // m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
622 def : InstRW<[WriteShift],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
623 (instregex "SET(O|NO|B|AE|E|NE|BE|A|S|NS|P|NP|L|GE|LE|G)m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
624
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
625 // LZCNT TZCNT.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
626 // r,r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
627 def : InstRW<[ZnWriteALULat2], (instregex "(LZCNT|TZCNT)(16|32|64)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
628 // r,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
629 def : InstRW<[ZnWriteALULat2Ld, ReadAfterLd], (instregex "(LZCNT|TZCNT)(16|32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
630
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
631 //-- Misc instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
632 // CMPXCHG.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
633 def ZnWriteCMPXCHG : SchedWriteRes<[ZnAGU, ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
634 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
635 let NumMicroOps = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
636 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
637 def : InstRW<[ZnWriteCMPXCHG], (instregex "CMPXCHG(8|16|32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
638
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
639 // CMPXCHG8B.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
640 def ZnWriteCMPXCHG8B : SchedWriteRes<[ZnAGU, ZnALU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
641 let NumMicroOps = 18;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
642 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
643 def : InstRW<[ZnWriteCMPXCHG8B], (instregex "CMPXCHG8B")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
644
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
645 def : InstRW<[WriteMicrocoded], (instregex "CMPXCHG16B")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
646
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
647 // LEAVE
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
648 def ZnWriteLEAVE : SchedWriteRes<[ZnALU, ZnAGU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
649 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
650 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
651 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
652 def : InstRW<[ZnWriteLEAVE], (instregex "LEAVE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
653
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
654 // PAUSE.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
655 def : InstRW<[WriteMicrocoded], (instregex "PAUSE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
656
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
657 // RDTSC.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
658 def : InstRW<[WriteMicrocoded], (instregex "RDTSC")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
659
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
660 // RDPMC.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
661 def : InstRW<[WriteMicrocoded], (instregex "RDPMC")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
662
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
663 // RDRAND.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
664 def : InstRW<[WriteMicrocoded], (instregex "RDRAND(16|32|64)r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
665
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
666 // XGETBV.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
667 def : InstRW<[WriteMicrocoded], (instregex "XGETBV")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
668
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
669 //-- String instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
670 // CMPS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
671 def : InstRW<[WriteMicrocoded], (instregex "CMPS(B|L|Q|W)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
672
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
673 // LODSB/W.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
674 def : InstRW<[WriteMicrocoded], (instregex "LODS(B|W)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
675
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
676 // LODSD/Q.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
677 def : InstRW<[WriteMicrocoded], (instregex "LODS(L|Q)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
678
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
679 // MOVS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
680 def : InstRW<[WriteMicrocoded], (instregex "MOVS(B|L|Q|W)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
681
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
682 // SCAS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
683 def : InstRW<[WriteMicrocoded], (instregex "SCAS(B|W|L|Q)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
684
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
685 // STOS
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
686 def : InstRW<[WriteMicrocoded], (instregex "STOS(B|L|Q|W)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
687
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
688 // XADD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
689 def : InstRW<[WriteMicrocoded], (instregex "XADD(8|16|32|64)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
690
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
691 //=== Floating Point x87 Instructions ===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
692 //-- Move instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
693
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
694 def ZnWriteFLDr : SchedWriteRes<[ZnFPU13]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
695
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
696 def ZnWriteSTr: SchedWriteRes<[ZnFPU23]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
697 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
698 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
699 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
700
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
701 // LD_F.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
702 // r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
703 def : InstRW<[ZnWriteFLDr], (instregex "LD_Frr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
704
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
705 // m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
706 def ZnWriteLD_F80m : SchedWriteRes<[ZnAGU, ZnFPU13]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
707 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
708 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
709 def : InstRW<[ZnWriteLD_F80m], (instregex "LD_F80m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
710
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
711 // FBLD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
712 def : InstRW<[WriteMicrocoded], (instregex "FBLDm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
713
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
714 // FST(P).
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
715 // r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
716 def : InstRW<[ZnWriteSTr], (instregex "ST_(F|FP)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
717
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
718 // m80.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
719 def ZnWriteST_FP80m : SchedWriteRes<[ZnAGU, ZnFPU23]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
720 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
721 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
722 def : InstRW<[ZnWriteST_FP80m], (instregex "ST_FP80m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
723
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
724 // FBSTP.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
725 // m80.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
726 def : InstRW<[WriteMicrocoded], (instregex "FBSTPm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
727
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
728 def ZnWriteFXCH : SchedWriteRes<[ZnFPU]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
729
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
730 // FXCHG.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
731 def : InstRW<[ZnWriteFXCH], (instregex "XCH_F")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
732
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
733 // FILD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
734 def ZnWriteFILD : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
735 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
736 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
737 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
738 def : InstRW<[ZnWriteFILD], (instregex "ILD_F(16|32|64)m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
739
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
740 // FIST(P) FISTTP.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
741 def ZnWriteFIST : SchedWriteRes<[ZnAGU, ZnFPU23]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
742 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
743 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
744 def : InstRW<[ZnWriteFIST], (instregex "IST_(F|FP)(16|32)m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
745
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
746 def ZnWriteFPU13 : SchedWriteRes<[ZnAGU, ZnFPU13]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
747 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
748 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
749
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
750 def ZnWriteFPU3 : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
751 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
752 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
753
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
754 // FLDZ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
755 def : InstRW<[ZnWriteFPU13], (instregex "LD_F0")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
756
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
757 // FLD1.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
758 def : InstRW<[ZnWriteFPU3], (instregex "LD_F1")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
759
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
760 // FLDPI FLDL2E etc.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
761 def : InstRW<[ZnWriteFPU3], (instregex "FLDPI", "FLDL2(T|E)" "FLDL(G|N)2")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
762
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
763 def : InstRW<[WriteMicrocoded], (instregex "CMOV(B|BE|P|NB|NBE|NE|NP)_F")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
764
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
765 // FNSTSW.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
766 // AX.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
767 def : InstRW<[WriteMicrocoded], (instregex "FNSTSW16r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
768
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
769 // m16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
770 def : InstRW<[WriteMicrocoded], (instregex "FNSTSWm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
771
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
772 // FLDCW.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
773 def : InstRW<[WriteMicrocoded], (instregex "FLDCW16m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
774
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
775 // FNSTCW.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
776 def : InstRW<[WriteMicrocoded], (instregex "FNSTCW16m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
777
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
778 // FINCSTP FDECSTP.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
779 def : InstRW<[ZnWriteFPU3], (instregex "FINCSTP", "FDECSTP")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
780
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
781 // FFREE.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
782 def : InstRW<[ZnWriteFPU3], (instregex "FFREE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
783
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
784 // FNSAVE.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
785 def : InstRW<[WriteMicrocoded], (instregex "FSAVEm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
786
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
787 // FRSTOR.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
788 def : InstRW<[WriteMicrocoded], (instregex "FRSTORm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
789
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
790 //-- Arithmetic instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
791
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
792 def ZnWriteFPU3Lat2 : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
793 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
794 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
795
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
796 def ZnWriteFPU3Lat2Ld : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
797 let Latency = 9;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
798 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
799
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
800 def ZnWriteFPU3Lat1 : SchedWriteRes<[ZnFPU3]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
801
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
802 def ZnWriteFPU0Lat1 : SchedWriteRes<[ZnFPU0]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
803
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
804 def ZnWriteFPU0Lat1Ld : SchedWriteRes<[ZnAGU, ZnFPU0]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
805 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
806 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
807
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
808 // FABS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
809 def : InstRW<[ZnWriteFPU3Lat2], (instregex "ABS_F")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
810
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
811 // FCHS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
812 def : InstRW<[ZnWriteFPU3Lat1], (instregex "CHS_F")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
813
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
814 // FCOM(P) FUCOM(P).
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
815 // r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
816 def : InstRW<[ZnWriteFPU0Lat1], (instregex "COM_FST0r", "COMP_FST0r", "UCOM_Fr",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
817 "UCOM_FPr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
818 // m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
819 def : InstRW<[ZnWriteFPU0Lat1Ld], (instregex "FCOM(32|64)m", "FCOMP(32|64)m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
820
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
821 // FCOMPP FUCOMPP.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
822 // r.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
823 def : InstRW<[ZnWriteFPU0Lat1], (instregex "FCOMPP", "UCOM_FPPr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
824
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
825 def ZnWriteFPU02 : SchedWriteRes<[ZnAGU, ZnFPU02]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
826 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
827 let Latency = 9;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
828 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
829
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
830 // FCOMI(P) FUCOMI(P).
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
831 // m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
832 def : InstRW<[ZnWriteFPU02], (instregex "COM_FIr", "COM_FIPr", "UCOM_FIr",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
833 "UCOM_FIPr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
834
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
835 def ZnWriteFPU03 : SchedWriteRes<[ZnAGU, ZnFPU03]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
836 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
837 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
838 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
839 let ResourceCycles = [1,3];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
840 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
841
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
842 // FICOM(P).
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
843 def : InstRW<[ZnWriteFPU03], (instregex "FICOM(16|32)m", "FICOMP(16|32)m")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
844
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
845 // FTST.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
846 def : InstRW<[ZnWriteFPU0Lat1], (instregex "TST_F")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
847
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
848 // FXAM.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
849 def : InstRW<[ZnWriteFPU3Lat1], (instregex "FXAM")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
850
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
851 // FPREM.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
852 def : InstRW<[WriteMicrocoded], (instregex "FPREM")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
853
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
854 // FPREM1.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
855 def : InstRW<[WriteMicrocoded], (instregex "FPREM1")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
856
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
857 // FRNDINT.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
858 def : InstRW<[WriteMicrocoded], (instregex "FRNDINT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
859
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
860 // FSCALE.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
861 def : InstRW<[WriteMicrocoded], (instregex "FSCALE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
862
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
863 // FXTRACT.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
864 def : InstRW<[WriteMicrocoded], (instregex "FXTRACT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
865
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
866 // FNOP.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
867 def : InstRW<[ZnWriteFPU0Lat1], (instregex "FNOP")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
868
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
869 // WAIT.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
870 def : InstRW<[ZnWriteFPU0Lat1], (instregex "WAIT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
871
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
872 // FNCLEX.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
873 def : InstRW<[WriteMicrocoded], (instregex "FNCLEX")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
874
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
875 // FNINIT.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
876 def : InstRW<[WriteMicrocoded], (instregex "FNINIT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
877
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
878 //=== Integer MMX and XMM Instructions ===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
879 //-- Move instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
880
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
881 // Moves from GPR to FPR incurs a penalty
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
882 def ZnWriteFPU2 : SchedWriteRes<[ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
883 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
884 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
885
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
886 // Move to ALU doesn't incur penalty
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
887 def ZnWriteToALU2 : SchedWriteRes<[ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
888 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
889 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
890
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
891 def ZnWriteFPU : SchedWriteRes<[ZnFPU]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
892 def ZnWriteFPUY : SchedWriteRes<[ZnFPU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
893 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
894 let Latency=2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
895 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
896
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
897 // MOVD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
898 // r32/64 <- (x)mm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
899 def : InstRW<[ZnWriteToALU2], (instregex "MMX_MOVD64grr", "MMX_MOVD64from64rr",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
900 "VMOVPDI2DIrr", "MOVPDI2DIrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
901
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
902 // (x)mm <- r32/64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
903 def : InstRW<[ZnWriteFPU2], (instregex "MMX_MOVD64rr", "MMX_MOVD64to64rr",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
904 "VMOVDI2PDIrr", "MOVDI2PDIrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
905
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
906 // MOVQ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
907 // r64 <- (x)mm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
908 def : InstRW<[ZnWriteToALU2], (instregex "VMOVPQIto64rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
909
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
910 // (x)mm <- r64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
911 def : InstRW<[ZnWriteFPU2], (instregex "VMOV64toPQIrr", "VMOVZQI2PQIrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
912
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
913 // (x)mm <- (x)mm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
914 def : InstRW<[ZnWriteFPU], (instregex "MMX_MOVQ64rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
915
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
916 // (V)MOVDQA/U.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
917 // x <- x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
918 def : InstRW<[ZnWriteFPU], (instregex "MOVDQ(A|U)rr", "VMOVDQ(A|U)rr",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
919 "MOVDQ(A|U)rr_REV", "VMOVDQ(A|U)rr_REV")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
920
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
921 // y <- y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
922 def : InstRW<[ZnWriteFPUY], (instregex "VMOVDQ(A|U)Yrr", "VMOVDQ(A|U)Yrr_REV")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
923
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
924 // MOVDQ2Q.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
925 def : InstRW<[ZnWriteFPU], (instregex "MMX_MOVDQ2Qrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
926
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
927 // MOVQ2DQ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
928 def : InstRW<[ZnWriteFPU], (instregex "MMX_MOVQ2DQrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
929
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
930 // PACKSSWB/DW.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
931 // mm <- mm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
932 def ZnWriteFPU12 : SchedWriteRes<[ZnFPU12]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
933 def ZnWriteFPU12Y : SchedWriteRes<[ZnFPU12]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
934 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
935 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
936 def ZnWriteFPU12m : SchedWriteRes<[ZnAGU, ZnFPU12]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
937
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
938 def : InstRW<[ZnWriteFPU12], (instregex "MMX_PACKSSDWirr",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
939 "MMX_PACKSSWBirr", "MMX_PACKUSWBirr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
940 def : InstRW<[ZnWriteFPU12m], (instregex "MMX_PACKSSDWirm",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
941 "MMX_PACKSSWBirm", "MMX_PACKUSWBirm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
942
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
943 // VPMOVSX/ZX BW BD BQ DW DQ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
944 // y <- x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
945 def : InstRW<[ZnWriteFPU12Y], (instregex "VPMOV(SX|ZX)(BW|BQ|DW|DQ)Yrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
946
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
947 def ZnWriteFPU013 : SchedWriteRes<[ZnFPU013]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
948 def ZnWriteFPU013Y : SchedWriteRes<[ZnFPU013]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
949 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
950 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
951 def ZnWriteFPU013m : SchedWriteRes<[ZnAGU, ZnFPU013]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
952 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
953 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
954 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
955 def ZnWriteFPU013Ld : SchedWriteRes<[ZnAGU, ZnFPU013]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
956 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
957 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
958 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
959 def ZnWriteFPU013LdY : SchedWriteRes<[ZnAGU, ZnFPU013]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
960 let Latency = 9;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
961 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
962 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
963
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
964 // PBLENDW.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
965 // x,x,i / v,v,v,i
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
966 def : InstRW<[ZnWriteFPU013], (instregex "(V?)PBLENDWrri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
967 // ymm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
968 def : InstRW<[ZnWriteFPU013Y], (instregex "(V?)PBLENDWYrri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
969
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
970 // x,m,i / v,v,m,i
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
971 def : InstRW<[ZnWriteFPU013Ld], (instregex "(V?)PBLENDWrmi")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
972 // y,m,i
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
973 def : InstRW<[ZnWriteFPU013LdY], (instregex "(V?)PBLENDWYrmi")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
974
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
975 def ZnWriteFPU01 : SchedWriteRes<[ZnFPU01]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
976 def ZnWriteFPU01Y : SchedWriteRes<[ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
977 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
978 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
979
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
980 // VPBLENDD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
981 // v,v,v,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
982 def : InstRW<[ZnWriteFPU01], (instregex "VPBLENDDrri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
983 // ymm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
984 def : InstRW<[ZnWriteFPU01Y], (instregex "VPBLENDDYrri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
985
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
986 // v,v,m,i
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
987 def ZnWriteFPU01Op2 : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
988 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
989 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
990 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
991 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
992 def ZnWriteFPU01Op2Y : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
993 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
994 let Latency = 9;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
995 let ResourceCycles = [1, 3];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
996 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
997 def : InstRW<[ZnWriteFPU01Op2], (instregex "VPBLENDDrmi")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
998 def : InstRW<[ZnWriteFPU01Op2Y], (instregex "VPBLENDDYrmi")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
999
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1000 // MASKMOVQ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1001 def : InstRW<[WriteMicrocoded], (instregex "MMX_MASKMOVQ(64)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1002
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1003 // MASKMOVDQU.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1004 def : InstRW<[WriteMicrocoded], (instregex "(V?)MASKMOVDQU(64)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1005
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1006 // VPMASKMOVQ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1007 // ymm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1008 def : InstRW<[ZnWriteFPU01Op2],(instregex "VPMASKMOVQrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1009 def : InstRW<[ZnWriteFPU01Op2Y],(instregex "VPMASKMOVQYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1010
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1011 def : InstRW<[WriteMicrocoded],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1012 (instregex "VPMASKMOVD(Y?)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1013 // m, v,v.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1014 def : InstRW<[WriteMicrocoded], (instregex "VPMASKMOV(D|Q)(Y?)mr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1015
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1016 // PMOVMSKB.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1017 def ZnWritePMOVMSKB : SchedWriteRes<[ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1018 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1019 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1020 def ZnWritePMOVMSKBY : SchedWriteRes<[ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1021 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1022 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1023 def : InstRW<[ZnWritePMOVMSKB], (instregex "(V|MMX_)?PMOVMSKBrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1024 def : InstRW<[ZnWritePMOVMSKBY], (instregex "(V|MMX_)?PMOVMSKBYrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1025
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1026 // PEXTR B/W/D/Q.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1027 // r32,x,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1028 def ZnWritePEXTRr : SchedWriteRes<[ZnFPU12, ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1029 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1030 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1031 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1032 def : InstRW<[ZnWritePEXTRr], (instregex "PEXTR(B|W|D|Q)rr", "MMX_PEXTRWirri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1033
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1034 def ZnWritePEXTRm : SchedWriteRes<[ZnAGU, ZnFPU12, ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1035 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1036 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1037 let ResourceCycles = [1, 2, 3];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1038 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1039 // m8,x,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1040 def : InstRW<[ZnWritePEXTRm], (instregex "PEXTR(B|W|D|Q)mr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1041
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1042 // VPBROADCAST B/W.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1043 // x, m8/16.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1044 def ZnWriteVPBROADCAST128Ld : SchedWriteRes<[ZnAGU, ZnFPU12]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1045 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1046 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1047 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1048 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1049 def : InstRW<[ZnWriteVPBROADCAST128Ld],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1050 (instregex "VPBROADCAST(B|W)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1051
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1052 // y, m8/16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1053 def ZnWriteVPBROADCAST256Ld : SchedWriteRes<[ZnAGU, ZnFPU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1054 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1055 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1056 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1057 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1058 def : InstRW<[ZnWriteVPBROADCAST256Ld],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1059 (instregex "VPBROADCAST(B|W)Yrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1060
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1061 // VPGATHER.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1062 def : InstRW<[WriteMicrocoded], (instregex "VPGATHER(Q|D)(Q|D)(Y?)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1063
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1064 //-- Arithmetic instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1065
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1066 // HADD, HSUB PS/PD
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1067 // PHADD|PHSUB (S) W/D.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1068 def : InstRW<[WriteMicrocoded], (instregex "MMX_PHADD(W?)r(r|m)64",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1069 "MMX_PHADDSWr(r|m)64",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1070 "MMX_PHSUB(W|D)r(r|m)64",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1071 "MMX_PHSUBSWrr64",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1072 "(V?)PH(ADD|SUB)(W|D)(Y?)r(r|m)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1073 "(V?)PH(ADD|SUB)SWr(r|m)(256)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1074
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1075
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1076 // PCMPGTQ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1077 def ZnWritePCMPGTQr : SchedWriteRes<[ZnFPU03]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1078 def : InstRW<[ZnWritePCMPGTQr], (instregex "(V?)PCMPGTQ(Y?)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1079
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1080 // x <- x,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1081 def ZnWritePCMPGTQm : SchedWriteRes<[ZnAGU, ZnFPU03]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1082 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1083 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1084 // ymm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1085 def ZnWritePCMPGTQYm : SchedWriteRes<[ZnAGU, ZnFPU03]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1086 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1087 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1088 let ResourceCycles = [1,2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1089 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1090 def : InstRW<[ZnWritePCMPGTQm], (instregex "(V?)PCMPGTQrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1091 def : InstRW<[ZnWritePCMPGTQYm], (instregex "(V?)PCMPGTQYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1092
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1093 // PMULLD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1094 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1095 def ZnWritePMULLDr : SchedWriteRes<[ZnFPU0]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1096 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1097 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1098 // ymm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1099 def ZnWritePMULLDYr : SchedWriteRes<[ZnFPU0]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1100 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1101 let ResourceCycles = [2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1102 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1103 def : InstRW<[ZnWritePMULLDr], (instregex "(V?)PMULLDrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1104 def : InstRW<[ZnWritePMULLDYr], (instregex "(V?)PMULLDYrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1105
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1106 // x,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1107 def ZnWritePMULLDm : SchedWriteRes<[ZnAGU, ZnFPU0]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1108 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1109 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1110 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1111 // y,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1112 def ZnWritePMULLDYm : SchedWriteRes<[ZnAGU, ZnFPU0]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1113 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1114 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1115 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1116 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1117 def : InstRW<[ZnWritePMULLDm], (instregex "(V?)PMULLDrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1118 def : InstRW<[ZnWritePMULLDYm], (instregex "(V?)PMULLDYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1119
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1120 //-- Logic instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1122 // PTEST.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1123 // v,v.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1124 def ZnWritePTESTr : SchedWriteRes<[ZnFPU12]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1125 let ResourceCycles = [2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1126 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1127 def : InstRW<[ZnWritePTESTr], (instregex "(V?)PTEST(Y?)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1128
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1129 // v,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1130 def ZnWritePTESTm : SchedWriteRes<[ZnAGU, ZnFPU12]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1131 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1132 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1133 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1134 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1135 def : InstRW<[ZnWritePTESTm], (instregex "(V?)PTEST(Y?)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1136
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1137 // PSLL,PSRL,PSRA W/D/Q.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1138 // x,x / v,v,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1139 def ZnWritePShift : SchedWriteRes<[ZnFPU2]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1140 def ZnWritePShiftY : SchedWriteRes<[ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1141 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1142 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1143 def ZnWritePShiftLd : SchedWriteRes<[ZnAGU,ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1144 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1145 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1146 def ZnWritePShiftYLd : SchedWriteRes<[ZnAGU, ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1147 let Latency = 9;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1148 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1149 def : InstRW<[ZnWritePShift], (instregex "(V?)PS(LL|RL|RA)(W|D|Q)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1150 def : InstRW<[ZnWritePShiftY], (instregex "(V?)PS(LL|RL|RA)(W|D|Q)Yrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1151
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1152 def : InstRW<[ZnWritePShiftLd], (instregex "(V?)PS(LL|RL|RA)(W|D|Q)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1153 def : InstRW<[ZnWritePShiftYLd], (instregex "(V?)PS(LL|RL|RA)(W|D|Q)Yrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1154
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1155 // PSLL,PSRL DQ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1156 def : InstRW<[ZnWritePShift], (instregex "(V?)PS(R|L)LDQri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1157 def : InstRW<[ZnWritePShiftY], (instregex "(V?)PS(R|L)LDQYri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1158
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1159 //=== Floating Point XMM and YMM Instructions ===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1160 //-- Move instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1161
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1162 // MOVMSKP S/D.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1163 // r32 <- x,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1164 def ZnWriteMOVMSKPr : SchedWriteRes<[ZnFPU2]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1165 def : InstRW<[ZnWriteMOVMSKPr], (instregex "(V?)MOVMSKP(S|D)(Y?)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1166
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1167 // VPERM2F128.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1168 def : InstRW<[WriteMicrocoded], (instregex "VPERM2F128rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1169 def : InstRW<[WriteMicrocoded], (instregex "VPERM2F128rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1170
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1171 // BLENDVP S/D.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1172 def ZnWriteFPU01Lat3 : SchedWriteRes<[ZnFPU013]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1173 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1174 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1175 def ZnWriteFPU01Lat3Ld : SchedWriteRes<[ZnAGU, ZnFPU013]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1176 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1177 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1178 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1179 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1180 def : InstRW<[ZnWriteFPU01Lat3], (instregex "BLENDVP(S|D)rr0")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1181 def : InstRW<[ZnWriteFPU01Lat3Ld, ReadAfterLd], (instregex "BLENDVP(S|D)rm0")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1182
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1183 def ZnWriteBROADCAST : SchedWriteRes<[ZnAGU, ZnFPU13]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1184 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1185 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1186 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1187 // VBROADCASTF128.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1188 def : InstRW<[ZnWriteBROADCAST], (instregex "VBROADCASTF128")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1189
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1190 // EXTRACTPS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1191 // r32,x,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1192 def ZnWriteEXTRACTPSr : SchedWriteRes<[ZnFPU12, ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1193 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1194 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1195 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1196 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1197 def : InstRW<[ZnWriteEXTRACTPSr], (instregex "(V?)EXTRACTPSrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1198
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1199 def ZnWriteEXTRACTPSm : SchedWriteRes<[ZnAGU,ZnFPU12, ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1200 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1201 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1202 let ResourceCycles = [5, 1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1203 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1204 // m32,x,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1205 def : InstRW<[ZnWriteEXTRACTPSm], (instregex "(V?)EXTRACTPSmr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1206
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1207 // VEXTRACTF128.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1208 // x,y,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1209 def : InstRW<[ZnWriteFPU013], (instregex "VEXTRACTF128rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1210
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1211 // m128,y,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1212 def : InstRW<[ZnWriteFPU013m], (instregex "VEXTRACTF128mr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1213
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1214 def ZnWriteVINSERT128r: SchedWriteRes<[ZnFPU013]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1215 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1216 let ResourceCycles = [2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1217 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1218 def ZnWriteVINSERT128Ld: SchedWriteRes<[ZnAGU,ZnFPU013]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1219 let Latency = 9;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1220 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1221 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1222 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1223 // VINSERTF128.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1224 // y,y,x,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1225 def : InstRW<[ZnWriteVINSERT128r], (instregex "VINSERTF128rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1226 def : InstRW<[ZnWriteVINSERT128Ld], (instregex "VINSERTF128rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1227
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1228 // VMASKMOVP S/D.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1229 // x,x,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1230 def ZnWriteVMASKMOVPLd : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1231 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1232 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1233 // y,y,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1234 def ZnWriteVMASKMOVPLdY : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1235 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1236 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1237 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1238 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1239 def ZnWriteVMASKMOVPm : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1240 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1241 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1242 def : InstRW<[ZnWriteVMASKMOVPLd], (instregex "VMASKMOVP(S|D)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1243 def : InstRW<[ZnWriteVMASKMOVPLdY], (instregex "VMASKMOVP(S|D)Yrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1244 def : InstRW<[ZnWriteVMASKMOVPm], (instregex "VMASKMOVP(S|D)mr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1245
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1246 // m256,y,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1247 def ZnWriteVMASKMOVPYmr : SchedWriteRes<[ZnAGU,ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1248 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1249 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1250 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1251 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1252 def : InstRW<[ZnWriteVMASKMOVPYmr], (instregex "VMASKMOVP(S|D)Ymr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1253
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1254 // VGATHERDPS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1255 // x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1256 def : InstRW<[WriteMicrocoded], (instregex "VGATHERDPSrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1257 // y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1258 def : InstRW<[WriteMicrocoded], (instregex "VGATHERDPSYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1259
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1260 // VGATHERQPS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1261 // x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1262 def : InstRW<[WriteMicrocoded], (instregex "VGATHERQPSrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1263
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1264 // y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1265 def : InstRW<[WriteMicrocoded], (instregex "VGATHERQPSYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1266
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1267 // VGATHERDPD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1268 // x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1269 def : InstRW<[WriteMicrocoded], (instregex "VGATHERDPDrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1270
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1271 // y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1272 def : InstRW<[WriteMicrocoded], (instregex "VGATHERDPDYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1273
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1274 // VGATHERQPD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1275 // x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1276 def : InstRW<[WriteMicrocoded], (instregex "VGATHERQPDrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1277
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1278 // y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1279 def : InstRW<[WriteMicrocoded], (instregex "VGATHERQPDYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1280
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1281 //-- Conversion instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1282 def ZnWriteCVTPD2PSr: SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1283 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1284 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1285 // CVTPD2PS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1286 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1287 def : InstRW<[ZnWriteCVTPD2PSr], (instregex "(V?)CVTPD2PSrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1288
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1289 def ZnWriteCVTPD2PSLd: SchedWriteRes<[ZnAGU,ZnFPU03]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1290 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1291 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1292 let ResourceCycles = [1,2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1293 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1294 // x,m128.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1295 def : InstRW<[ZnWriteCVTPD2PSLd], (instregex "(V?)CVTPD2PS(X?)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1296
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1297 // x,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1298 def ZnWriteCVTPD2PSYr : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1299 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1300 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1301 def : InstRW<[ZnWriteCVTPD2PSYr], (instregex "(V?)CVTPD2PSYrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1302
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1303 // x,m256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1304 def ZnWriteCVTPD2PSYLd : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1305 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1306 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1307 def : InstRW<[ZnWriteCVTPD2PSYLd], (instregex "(V?)CVTPD2PSYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1308
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1309 // CVTSD2SS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1310 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1311 // Same as WriteCVTPD2PSr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1312 def : InstRW<[ZnWriteCVTPD2PSr], (instregex "(Int_)?(V)?CVTSD2SSrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1313
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1314 // x,m64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1315 def : InstRW<[ZnWriteCVTPD2PSLd], (instregex "(Int_)?(V)?CVTSD2SSrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1316
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1317 // CVTPS2PD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1318 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1319 def ZnWriteCVTPS2PDr : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1320 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1321 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1322 def : InstRW<[ZnWriteCVTPS2PDr], (instregex "(V?)CVTPS2PDrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1323
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1324 // x,m64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1325 // y,m128.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1326 def ZnWriteCVTPS2PDLd : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1327 let Latency = 10;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1328 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1329 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1330 def : InstRW<[ZnWriteCVTPS2PDLd], (instregex "(V?)CVTPS2PD(Y?)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1331
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1332 // y,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1333 def ZnWriteVCVTPS2PDY : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1334 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1335 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1336 def : InstRW<[ZnWriteVCVTPS2PDY], (instregex "VCVTPS2PDYrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1337
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1338 // CVTSS2SD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1339 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1340 def ZnWriteCVTSS2SDr : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1341 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1342 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1343 def : InstRW<[ZnWriteCVTSS2SDr], (instregex "(Int_)?(V?)CVTSS2SDrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1344
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1345 // x,m32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1346 def ZnWriteCVTSS2SDLd : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1347 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1348 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1349 let ResourceCycles = [1, 2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1350 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1351 def : InstRW<[ZnWriteCVTSS2SDLd], (instregex "(Int_)?(V?)CVTSS2SDrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1352
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1353 def ZnWriteCVTDQ2PDr: SchedWriteRes<[ZnFPU12,ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1354 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1355 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1356 // CVTDQ2PD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1357 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1358 def : InstRW<[ZnWriteCVTDQ2PDr], (instregex "(V)?CVTDQ2PDrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1359
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1360 // Same as xmm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1361 // y,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1362 def : InstRW<[ZnWriteCVTDQ2PDr], (instregex "VCVTDQ2PDYrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1363
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1364 def ZnWriteCVTPD2DQr: SchedWriteRes<[ZnFPU12, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1365 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1366 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1367 // CVT(T)PD2DQ.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1368 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1369 def : InstRW<[ZnWriteCVTDQ2PDr], (instregex "(V?)CVT(T?)PD2DQrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1370
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1371 def ZnWriteCVTPD2DQLd: SchedWriteRes<[ZnAGU,ZnFPU12,ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1372 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1373 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1374 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1375 // x,m128.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1376 def : InstRW<[ZnWriteCVTPD2DQLd], (instregex "(V?)CVT(T?)PD2DQrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1377 // same as xmm handling
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1378 // x,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1379 def : InstRW<[ZnWriteCVTPD2DQr], (instregex "VCVT(T?)PD2DQYrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1380 // x,m256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1381 def : InstRW<[ZnWriteCVTPD2DQLd], (instregex "VCVT(T?)PD2DQYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1382 def : InstRW<[ZnWriteCVTPD2DQLd], (instregex "VCVT(T?)PD2DQ(64)?rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1383
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1384 def ZnWriteCVTPS2PIr: SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1385 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1386 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1387 // CVT(T)PS2PI.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1388 // mm,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1389 def : InstRW<[ZnWriteCVTPS2PIr], (instregex "MMX_CVT(T?)PS2PIirr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1390
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1391 // CVTPI2PD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1392 // x,mm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1393 def : InstRW<[ZnWriteCVTPS2PDr], (instregex "MMX_CVT(T?)PI2PDirr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1394
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1395 // CVT(T)PD2PI.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1396 // mm,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1397 def : InstRW<[ZnWriteCVTPS2PIr], (instregex "MMX_CVT(T?)PD2PIirr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1398
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1399 def ZnWriteCVSTSI2SSr: SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1400 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1401 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1402 // CVSTSI2SS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1403 // x,r32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1404 def : InstRW<[ZnWriteCVSTSI2SSr], (instregex "(Int_)?(V?)CVT(T?)SI2SS(64)?rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1405
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1406 // same as CVTPD2DQr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1407 // CVT(T)SS2SI.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1408 // r32,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1409 def : InstRW<[ZnWriteCVTPD2DQr], (instregex "(Int_)?(V?)CVT(T?)SS2SI(64)?rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1410 // same as CVTPD2DQm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1411 // r32,m32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1412 def : InstRW<[ZnWriteCVTPD2DQLd], (instregex "(Int_)?(V?)CVT(T?)SS2SI(64)?rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1413
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1414 def ZnWriteCVSTSI2SDr: SchedWriteRes<[ZnFPU013, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1415 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1416 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1417 // CVTSI2SD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1418 // x,r32/64.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1419 def : InstRW<[ZnWriteCVSTSI2SDr], (instregex "(Int_)?(V?)CVTSI2SS(64)?rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1420
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1421
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1422 def ZnWriteCVSTSI2SIr: SchedWriteRes<[ZnFPU3, ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1423 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1424 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1425 def ZnWriteCVSTSI2SILd: SchedWriteRes<[ZnAGU, ZnFPU3, ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1426 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1427 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1428 // CVTSD2SI.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1429 // r32/64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1430 def : InstRW<[ZnWriteCVSTSI2SIr], (instregex "(Int_)?CVT(T?)SD2SI(64)?rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1431 // r32,m32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1432 def : InstRW<[ZnWriteCVSTSI2SILd], (instregex "(Int_)?CVT(T?)SD2SI(64)?rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1433
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1434
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1435 def ZnWriteVCVSTSI2SIr: SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1436 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1437 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1438 def ZnWriteVCVSTSI2SILd: SchedWriteRes<[ZnFPU3, ZnAGU]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1439 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1440 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1441 // VCVTSD2SI.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1442 // r32/64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1443 def : InstRW<[ZnWriteCVSTSI2SIr], (instregex "(Int_)?VCVT(T?)SD2SI(64)?rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1444 // r32,m32.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1445 def : InstRW<[ZnWriteCVSTSI2SILd], (instregex "(Int_)?VCVT(T?)SD2SI(64)?rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1446
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1447 // VCVTPS2PH.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1448 // x,v,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1449 def : InstRW<[WriteMicrocoded], (instregex "VCVTPS2PH(Y?)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1450 // m,v,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1451 def : InstRW<[WriteMicrocoded], (instregex "VCVTPS2PH(Y?)mr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1452
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1453 // VCVTPH2PS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1454 // v,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1455 def : InstRW<[WriteMicrocoded], (instregex "VCVTPH2PS(Y?)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1456 // v,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1457 def : InstRW<[WriteMicrocoded], (instregex "VCVTPH2PS(Y?)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1458
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1459 //-- SSE4A instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1460 // EXTRQ
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1461 def ZnWriteEXTRQ: SchedWriteRes<[ZnFPU12, ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1462 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1463 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1464 def : InstRW<[ZnWriteEXTRQ], (instregex "EXTRQ")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1465
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1466 // INSERTQ
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1467 def ZnWriteINSERTQ: SchedWriteRes<[ZnFPU03,ZnFPU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1468 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1469 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1470 def : InstRW<[ZnWriteINSERTQ], (instregex "INSERTQ")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1471
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1472 // MOVNTSS/MOVNTSD
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1473 def ZnWriteMOVNT: SchedWriteRes<[ZnAGU,ZnFPU2]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1474 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1475 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1476 def : InstRW<[ZnWriteMOVNT], (instregex "MOVNTS(S|D)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1477
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1478 //-- SHA instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1479 // SHA256MSG2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1480 def : InstRW<[WriteMicrocoded], (instregex "SHA256MSG2(Y?)r(r|m)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1481
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1482 // SHA1MSG1, SHA256MSG1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1483 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1484 def ZnWriteSHA1MSG1r : SchedWriteRes<[ZnFPU12]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1485 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1486 let ResourceCycles = [2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1487 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1488 def : InstRW<[ZnWriteSHA1MSG1r], (instregex "SHA(1|256)MSG1rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1489 // x,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1490 def ZnWriteSHA1MSG1Ld : SchedWriteRes<[ZnAGU, ZnFPU12]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1491 let Latency = 9;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1492 let ResourceCycles = [1,2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1493 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1494 def : InstRW<[ZnWriteSHA1MSG1Ld], (instregex "SHA(1|256)MSG1rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1495
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1496 // SHA1MSG2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1497 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1498 def ZnWriteSHA1MSG2r : SchedWriteRes<[ZnFPU12]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1499 def : InstRW<[ZnWriteSHA1MSG2r], (instregex "SHA1MSG2rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1500 // x,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1501 def ZnWriteSHA1MSG2Ld : SchedWriteRes<[ZnAGU, ZnFPU12]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1502 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1503 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1504 def : InstRW<[ZnWriteSHA1MSG2Ld], (instregex "SHA1MSG2rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1505
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1506 // SHA1NEXTE
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1507 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1508 def ZnWriteSHA1NEXTEr : SchedWriteRes<[ZnFPU1]> ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1509 def : InstRW<[ZnWriteSHA1NEXTEr], (instregex "SHA1NEXTErr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1510 // x,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1511 def ZnWriteSHA1NEXTELd : SchedWriteRes<[ZnAGU, ZnFPU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1512 let Latency = 8;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1513 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1514 def : InstRW<[ZnWriteSHA1NEXTELd], (instregex "SHA1NEXTErm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1515
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1516 // SHA1RNDS4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1517 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1518 def ZnWriteSHA1RNDS4r : SchedWriteRes<[ZnFPU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1519 let Latency = 6;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1520 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1521 def : InstRW<[ZnWriteSHA1RNDS4r], (instregex "SHA1RNDS4rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1522 // x,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1523 def ZnWriteSHA1RNDS4Ld : SchedWriteRes<[ZnAGU, ZnFPU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1524 let Latency = 13;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1525 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1526 def : InstRW<[ZnWriteSHA1RNDS4Ld], (instregex "SHA1RNDS4rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1527
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1528 // SHA256RNDS2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1529 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1530 def ZnWriteSHA256RNDS2r : SchedWriteRes<[ZnFPU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1531 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1532 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1533 def : InstRW<[ZnWriteSHA256RNDS2r], (instregex "SHA256RNDS2rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1534 // x,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1535 def ZnWriteSHA256RNDS2Ld : SchedWriteRes<[ZnAGU, ZnFPU1]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1536 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1537 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1538 def : InstRW<[ZnWriteSHA256RNDS2Ld], (instregex "SHA256RNDS2rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1539
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1540 //-- Arithmetic instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1541
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1542 // HADD, HSUB PS/PD
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1543 def : InstRW<[WriteMicrocoded], (instregex "(V?)H(ADD|SUB)P(S|D)(Y?)r(r|m)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1544
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1545 // MULL SS/SD PS/PD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1546 // x,x / v,v,v.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1547 def ZnWriteMULr : SchedWriteRes<[ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1548 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1549 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1550 // ymm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1551 def ZnWriteMULYr : SchedWriteRes<[ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1552 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1553 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1554 def : InstRW<[ZnWriteMULr], (instregex "(V?)MUL(P|S)(S|D)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1555 def : InstRW<[ZnWriteMULYr], (instregex "(V?)MUL(P|S)(S|D)Yrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1556
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1557 // x,m / v,v,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1558 def ZnWriteMULLd : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1559 let Latency = 10;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1560 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1561 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1562 def : InstRW<[ZnWriteMULLd], (instregex "(V?)MUL(P|S)(S|D)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1563
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1564 // ymm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1565 def ZnWriteMULYLd : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1566 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1567 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1568 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1569 def : InstRW<[ZnWriteMULYLd], (instregex "(V?)MUL(P|S)(S|D)Yrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1570
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1571 // VDIVPS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1572 // y,y,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1573 def ZnWriteVDIVPSYr : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1574 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1575 let ResourceCycles = [12];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1576 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1577 def : InstRW<[ZnWriteVDIVPSYr], (instregex "VDIVPSYrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1578
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1579 // y,y,m256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1580 def ZnWriteVDIVPSYLd : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1581 let Latency = 19;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1582 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1583 let ResourceCycles = [1, 19];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1584 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1585 def : InstRW<[ZnWriteVDIVPSYLd], (instregex "VDIVPSYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1586
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1587 // VDIVPD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1588 // y,y,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1589 def ZnWriteVDIVPDY : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1590 let Latency = 15;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1591 let ResourceCycles = [15];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1592 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1593 def : InstRW<[ZnWriteVDIVPDY], (instregex "VDIVPDYrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1594
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1595 // y,y,m256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1596 def ZnWriteVDIVPDYLd : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1597 let Latency = 22;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1598 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1599 let ResourceCycles = [1,22];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1600 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1601 def : InstRW<[ZnWriteVDIVPDYLd], (instregex "VDIVPDYrm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1602
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1603 // VRCPPS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1604 // y,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1605 def ZnWriteVRCPPSr : SchedWriteRes<[ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1606 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1607 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1608 def : InstRW<[ZnWriteVRCPPSr], (instregex "VRCPPSYr(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1609
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1610 // y,m256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1611 def ZnWriteVRCPPSLd : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1612 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1613 let NumMicroOps = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1614 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1615 def : InstRW<[ZnWriteVRCPPSLd], (instregex "VRCPPSYm(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1616
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1617 // ROUND SS/SD PS/PD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1618 // v,v,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1619 def ZnWriteROUNDr : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1620 let Latency = 4;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1621 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1622 def : InstRW<[ZnWriteROUNDr], (instregex "(V?)ROUND(Y?)(S|P)(S|D)r(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1623
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1624 // VFMADD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1625 // v,v,v.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1626 def ZnWriteFMADDr : SchedWriteRes<[ZnFPU03]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1627 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1628 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1629 def : InstRW<[ZnWriteFMADDr],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1630 (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1631 "VF(N?)M(ADD|SUB|ADDSUB|SUBADD)P(S|D)(r213|r132|r231)r(Y)?",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1632 "VF(N?)M(ADD|SUB)S(S|D)(r132|r231|r213)r",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1633 "VF(N?)M(ADD|SUB)S(S|D)4rr(_REV|_Int)?",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1634 "VF(N?)M(ADD|SUB)P(S|D)4rr(Y)?(_REV)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1635
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1636 // v,v,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1637 def ZnWriteFMADDm : SchedWriteRes<[ZnAGU, ZnFPU03]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1638 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1639 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1640 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1641 def : InstRW<[ZnWriteFMADDm],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1642 (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1643 "VF(N?)M(ADD|SUB|ADDSUB|SUBADD)P(S|D)(r213|r132|r231)m(Y)?",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1644 "VF(N?)M(ADD|SUB)S(S|D)(r132|r231|r213)m",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1645 "VF(N?)M(ADD|SUB)S(S|D)4(rm|mr)(_Int)?",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1646 "VF(N?)M(ADD|SUB)P(S|D)4(rm|mr)(Y)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1647
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1648 // v,m,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1649 def ZnWriteROUNDm : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1650 let Latency = 11;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1651 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1652 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1653 def : InstRW<[ZnWriteROUNDm], (instregex "(V?)ROUND(Y?)(S|P)(S|D)m(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1654
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1655 // DPPS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1656 // x,x,i / v,v,v,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1657 def : InstRW<[WriteMicrocoded], (instregex "(V?)DPPS(Y?)rri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1658
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1659 // x,m,i / v,v,m,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1660 def : InstRW<[WriteMicrocoded], (instregex "(V?)DPPS(Y?)rmi")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1661
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1662 // DPPD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1663 // x,x,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1664 def : InstRW<[WriteMicrocoded], (instregex "(V?)DPPDrri")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1665
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1666 // x,m,i.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1667 def : InstRW<[WriteMicrocoded], (instregex "(V?)DPPDrmi")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1668
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1669 // VSQRTPS.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1670 // y,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1671 def ZnWriteVSQRTPSYr : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1672 let Latency = 28;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1673 let ResourceCycles = [28];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1674 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1675 def : InstRW<[ZnWriteVSQRTPSYr], (instregex "VSQRTPSYr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1676
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1677 // y,m256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1678 def ZnWriteVSQRTPSYLd : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1679 let Latency = 35;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1680 let ResourceCycles = [1,35];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1681 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1682 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1683 def : InstRW<[ZnWriteVSQRTPSYLd], (instregex "VSQRTPSYm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1684
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1685 // VSQRTPD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1686 // y,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1687 def ZnWriteVSQRTPDYr : SchedWriteRes<[ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1688 let Latency = 40;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1689 let ResourceCycles = [40];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1690 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1691 def : InstRW<[ZnWriteVSQRTPDYr], (instregex "VSQRTPDYr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1692
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1693 // y,m256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1694 def ZnWriteVSQRTPDYLd : SchedWriteRes<[ZnAGU, ZnFPU3]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1695 let Latency = 47;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1696 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1697 let ResourceCycles = [1,47];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1698 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1699 def : InstRW<[ZnWriteVSQRTPDYLd], (instregex "VSQRTPDYm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1700
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1701 // RSQRTSS
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1702 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1703 def ZnWriteRSQRTSSr : SchedWriteRes<[ZnFPU02]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1704 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1705 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1706 def : InstRW<[ZnWriteRSQRTSSr], (instregex "(V?)RSQRTSS(Y?)r(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1707
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1708 // RSQRTPS
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1709 // x,x.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1710 def ZnWriteRSQRTPSr : SchedWriteRes<[ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1711 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1712 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1713 def : InstRW<[ZnWriteRSQRTPSr], (instregex "(V?)RSQRTPS(Y?)r(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1714
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1715 // RSQRTSSm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1716 // x,m128.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1717 def ZnWriteRSQRTSSLd: SchedWriteRes<[ZnAGU, ZnFPU02]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1718 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1719 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1720 let ResourceCycles = [1,2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1721 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1722 def : InstRW<[ZnWriteRSQRTSSLd], (instregex "(V?)RSQRTSSm(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1723
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1724 // RSQRTPSm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1725 def ZnWriteRSQRTPSLd : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1726 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1727 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1728 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1729 def : InstRW<[ZnWriteRSQRTPSLd], (instregex "(V?)RSQRTPSm(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1730
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1731 // RSQRTPS 256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1732 // y,y.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1733 def ZnWriteRSQRTPSYr : SchedWriteRes<[ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1734 let Latency = 5;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1735 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1736 let ResourceCycles = [2];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1737 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1738 def : InstRW<[ZnWriteRSQRTPSYr], (instregex "VRSQRTPSYr(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1739
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1740 // y,m256.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1741 def ZnWriteRSQRTPSYLd : SchedWriteRes<[ZnAGU, ZnFPU01]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1742 let Latency = 12;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1743 let NumMicroOps = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1744 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1745 def : InstRW<[ZnWriteRSQRTPSYLd], (instregex "VRSQRTPSYm(_Int)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1746
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1747 //-- Logic instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1748
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1749 // AND, ANDN, OR, XOR PS/PD.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1750 // x,x / v,v,v.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1751 def : InstRW<[WriteVecLogic], (instregex "(V?)(AND|ANDN|OR|XOR)P(S|D)(Y?)rr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1752 // x,m / v,v,m.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1753 def : InstRW<[WriteVecLogicLd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1754 (instregex "(V?)(AND|ANDN|OR|XOR)P(S|D)(Y?)rm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1755
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1756 //-- Other instructions --//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1757
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1758 // VZEROUPPER.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1759 def : InstRW<[WriteMicrocoded], (instregex "VZEROUPPER")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1760
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1761 // VZEROALL.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1762 def : InstRW<[WriteMicrocoded], (instregex "VZEROALL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1763
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1764 // LDMXCSR.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1765 def : InstRW<[WriteMicrocoded], (instregex "(V)?LDMXCSR")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1766
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1767 // STMXCSR.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1768 def : InstRW<[WriteMicrocoded], (instregex "(V)?STMXCSR")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1769
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1770 } // SchedModel