1 //===-- CSKY.td - Describe the CSKY Target Machine ---------*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 include "llvm/Target/Target.td"
11 //===----------------------------------------------------------------------===//
12 // CSKY subtarget features and instruction predicates.
13 //===----------------------------------------------------------------------===//
15 SubtargetFeature<"hard-float", "UseHardFloat",
16 "true", "Use hard floating point features">;
17 def ModeHardFloatABI :
18 SubtargetFeature<"hard-float-abi", "UseHardFloatABI",
19 "true", "Use hard floating point ABI to pass args">;
22 : SubtargetFeature<"fpuv2_sf", "HasFPUv2SingleFloat", "true",
23 "Enable FPUv2 single float instructions">;
24 def HasFPUv2_SF : Predicate<"Subtarget->hasFPUv2SingleFloat()">,
25 AssemblerPredicate<(all_of FeatureFPUV2_SF),
26 "Enable FPUv2 single float instructions">;
29 : SubtargetFeature<"fpuv2_df", "HasFPUv2DoubleFloat", "true",
30 "Enable FPUv2 double float instructions">;
31 def HasFPUv2_DF : Predicate<"Subtarget->hasFPUv2DoubleFloat()">,
32 AssemblerPredicate<(all_of FeatureFPUV2_DF),
33 "Enable FPUv2 double float instructions">;
35 def FeatureFdivdu : SubtargetFeature<"fdivdu", "HasFdivdu", "true",
36 "Enable float divide instructions">;
37 def HasFdivdu : Predicate<"Subtarget->hasFdivdu()">,
38 AssemblerPredicate<(all_of FeatureFdivdu),
39 "Enable float divide instructions">;
42 : SubtargetFeature<"fpuv3_hi", "HasFPUv3HalfWord", "true",
43 "Enable FPUv3 half word converting instructions">;
44 def HasFPUv3_HI : Predicate<"Subtarget->hasFPUv3HalfWord()">,
45 AssemblerPredicate<(all_of FeatureFPUV3_HI),
46 "Enable FPUv3 half word converting instructions">;
49 : SubtargetFeature<"fpuv3_hf", "HasFPUv3HalfFloat", "true",
50 "Enable FPUv3 half precision operate instructions">;
51 def HasFPUv3_HF : Predicate<"Subtarget->hasFPUv3HalfFloat()">,
52 AssemblerPredicate<(all_of FeatureFPUV3_HF),
53 "Enable FPUv3 half precision operate instructions">;
56 : SubtargetFeature<"fpuv3_sf", "HasFPUv3SingleFloat", "true",
57 "Enable FPUv3 single float instructions">;
58 def HasFPUv3_SF : Predicate<"Subtarget->hasFPUv3SingleFloat()">,
59 AssemblerPredicate<(all_of FeatureFPUV3_SF),
60 "Enable FPUv3 single float instructions">;
63 : SubtargetFeature<"fpuv3_df", "HasFPUv3DoubleFloat", "true",
64 "Enable FPUv3 double float instructions">;
65 def HasFPUv3_DF : Predicate<"Subtarget->hasFPUv3DoubleFloat()">,
66 AssemblerPredicate<(all_of FeatureFPUV3_DF),
67 "Enable FPUv3 double float instructions">;
70 : SubtargetFeature<"floate1", "HasFLOATE1", "true", "Support CSKY floate1 instructions">;
71 def iHasFLOATE1 : Predicate<"Subtarget->hasFLOATE1()">,
72 AssemblerPredicate<(all_of HasFLOATE1),
73 "Support CSKY floate1 instructions">;
76 : SubtargetFeature<"float1e2", "HasFLOAT1E2", "true", "Support CSKY float1e2 instructions">;
77 def iHasFLOAT1E2 : Predicate<"Subtarget->hasFLOAT1E2()">,
78 AssemblerPredicate<(all_of HasFLOAT1E2),
79 "Support CSKY float1e2 instructions">;
82 : SubtargetFeature<"float1e3", "HasFLOAT1E3", "true", "Support CSKY float1e3 instructions">;
83 def iHasFLOAT1E3 : Predicate<"Subtarget->hasFLOAT1E3()">,
84 AssemblerPredicate<(all_of HasFLOAT1E3),
85 "Support CSKY float1e3 instructions">;
88 : SubtargetFeature<"float3e4", "HasFLOAT3E4", "true", "Support CSKY float3e4 instructions">;
89 def iHasFLOAT3E4 : Predicate<"Subtarget->hasFLOAT3E4()">,
90 AssemblerPredicate<(all_of HasFLOAT3E4),
91 "Support CSKY float3e4 instructions">;
94 : SubtargetFeature<"float7e60", "HasFLOAT7E60", "true", "Support CSKY float7e60 instructions">;
95 def iHasFLOAT7E60 : Predicate<"Subtarget->hasFLOAT7E60()">,
96 AssemblerPredicate<(all_of HasFLOAT7E60),
97 "Support CSKY float7e60 instructions">;
99 def FeatureHWDiv : SubtargetFeature<"hwdiv", "HasHardwareDivide", "true",
100 "Enable divide instrutions">;
101 def HasHWDiv : Predicate<"Subtarget->hasHardwareDivide()">,
102 AssemblerPredicate<(all_of FeatureHWDiv),
103 "Enable divide instrutions">;
105 def FeatureSTM : SubtargetFeature<"multiple_stld", "HasSTM", "true",
106 "Enable multiple load/store instrutions">;
107 def HasSTM : Predicate<"Subtarget->hasSTM()">,
108 AssemblerPredicate<(all_of FeatureSTM),
109 "Enable multiple load/store instrutions">;
111 def FeaturePushPop : SubtargetFeature<"pushpop", "HasPushPop", "true",
112 "Enable push/pop instrutions">;
113 def HasPushPop : Predicate<"Subtarget->hasPushPop()">,
114 AssemblerPredicate<(all_of FeaturePushPop),
115 "Enable push/pop instrutions">;
118 : SubtargetFeature<"edsp", "HasDSP", "true", "Enable DSP instrutions">;
119 def HasDSP : Predicate<"Subtarget->hasDSP()">,
120 AssemblerPredicate<(all_of FeatureDSP),
121 "Enable DSP instrutions">;
124 : SubtargetFeature<"dsp1e2", "HasDSP1E2", "true", "Support CSKY dsp1e2 instructions">;
125 def iHasDSP1E2 : Predicate<"Subtarget->hasDSP1E2()">,
126 AssemblerPredicate<(all_of HasDSP1E2),
127 "Support CSKY dsp1e2 instructions">;
130 : SubtargetFeature<"dspe60", "HasDSPE60", "true", "Support CSKY dspe60 instructions">;
131 def iHasDSPE60 : Predicate<"Subtarget->hasDSPE60()">,
132 AssemblerPredicate<(all_of HasDSPE60),
133 "Support CSKY dspe60 instructions">;
135 def FeatureDSPV2 : SubtargetFeature<"dspv2", "HasDSPV2", "true",
136 "Enable DSP V2.0 instrutions">;
137 def HasDSPV2 : Predicate<"Subtarget->hasDSPV2()">,
138 AssemblerPredicate<(all_of FeatureDSPV2),
139 "Enable DSP V2.0 instrutions">;
141 def FeatureDSP_Silan : SubtargetFeature<"dsp_silan", "HasDSP_Silan", "true",
142 "Enable DSP Silan instrutions">;
143 def HasDSP_Silan : Predicate<"Subtarget->hasDSP_Silan()">,
144 AssemblerPredicate<(all_of FeatureDSP_Silan),
145 "Enable DSP Silan instrutions">;
148 def FeatureBTST16 : SubtargetFeature<"btst16", "HasBTST16", "true",
149 "Use the 16-bit btsti instruction">;
150 def HasBTST16 : Predicate<"Subtarget->hasBTST16()">,
151 AssemblerPredicate<(all_of FeatureBTST16),
152 "Use the 16-bit btsti instruction">;
155 def FeatureExtendLrw : SubtargetFeature<"elrw", "HasExtendLrw", "true",
156 "Use the extend LRW instruction">;
157 def HasExtendLrw : Predicate<"Subtarget->hasExtendLrw()">,
158 AssemblerPredicate<(all_of FeatureExtendLrw),
159 "Use the extend LRW instruction">;
161 def FeatureTrust : SubtargetFeature<"trust", "HasTrust", "true",
162 "Enable trust instructions">;
163 def HasTrust : Predicate<"Subtarget->hasTrust()">,
164 AssemblerPredicate<(all_of FeatureTrust),
165 "Enable trust instructions">;
168 : SubtargetFeature<"java", "HasJAVA", "true", "Enable java instructions">;
169 def HasJAVA : Predicate<"Subtarget->hasJAVA()">,
170 AssemblerPredicate<(all_of FeatureJAVA),
171 "Enable java instructions">;
174 : SubtargetFeature<"cache", "HasCache", "true", "Enable cache">;
175 def HasCache : Predicate<"Subtarget->hasCache()">,
176 AssemblerPredicate<(all_of FeatureCache),
180 : SubtargetFeature<"nvic", "HasNVIC", "true", "Enable NVIC">;
181 def HasNVIC : Predicate<"Subtarget->hasNVIC()">,
182 AssemblerPredicate<(all_of FeatureNVIC),
185 def FeatureDoloop : SubtargetFeature<"doloop", "HasDoloop", "true",
186 "Enable doloop instructions">;
187 def HasDoloop : Predicate<"Subtarget->hasDoloop()">,
188 AssemblerPredicate<(all_of FeatureDoloop),
189 "Enable doloop instructions">;
191 // Other features than instructions
192 def FeatureHighreg : SubtargetFeature<"high-registers", "HasHighRegisters",
193 "true", "Enable r16-r31 registers">;
194 def HasHighRegisters : Predicate<"Subtarget->hasHighRegisters()">,
195 AssemblerPredicate<(all_of FeatureHighreg),
196 "Enable r16-r31 registers">;
198 def FeatureSmart : SubtargetFeature<"smart", "SmartMode", "true",
199 "Let CPU work in Smart Mode">;
200 def SmartMode : Predicate<"Subtarget->smartMode()">,
201 AssemblerPredicate<(all_of FeatureSmart),
202 "Let CPU work in Smart Mode">;
204 def FeatureVDSPV2 : SubtargetFeature<"vdspv2", "HasVDSPV2", "true",
205 "Enable vdsp-v2 instructions">;
206 def HasVDSPV2 : Predicate<"Subtarget->hasVDSPV2()">,
207 AssemblerPredicate<(all_of FeatureVDSPV2),
208 "Enable vdsp-v2 instructions">;
210 def HasVDSPV2_FLOAT : Predicate<"Subtarget->hasVDSPV2_FLOAT()">;
211 def HasVDSPV2_HALF: Predicate<"Subtarget->hasVDSPV2_HALF()">;
214 : SubtargetFeature<"vdsp2e3", "HasVDSP2E3", "true", "Support CSKY vdsp2e3 instructions">;
215 def iHasVDSP2E3 : Predicate<"Subtarget->hasVDSP2E3()">,
216 AssemblerPredicate<(all_of HasVDSP2E3),
217 "Support CSKY vdsp2e3 instructions">;
220 : SubtargetFeature<"vdsp2e60f", "HasVDSP2E60F", "true", "Support CSKY vdsp2e60f instructions">;
221 def iHasVDSP2E60F : Predicate<"Subtarget->hasVDSP2E60F()">,
222 AssemblerPredicate<(all_of HasVDSP2E60F),
223 "Support CSKY vdsp2e60f instructions">;
225 def FeatureHardTP : SubtargetFeature<"hard-tp", "ReadTPHard", "true",
226 "Enable TLS Pointer register">;
227 def ReadTPHard : Predicate<"Subtarget->readTPHard()">,
228 AssemblerPredicate<(all_of FeatureHardTP),
229 "Enable TLS Pointer register">;
231 def FeatureSoftTP : SubtargetFeature<"soft-tp", "ReadTPHard", "false",
232 "Disable TLS Pointer register">;
234 def FeatureIstack : SubtargetFeature<"istack", "EnableInterruptAttribute",
235 "true", "Enable interrput attribute">;
236 def EnableInterruptAttribute
237 : Predicate<"Subtarget->enableInterruptAttribute()">,
238 AssemblerPredicate<(all_of FeatureIstack),
239 "Enable interrput attribute">;
241 def FeatureConstPool : SubtargetFeature<"constpool", "DumpConstPool", "true",
242 "Dump the constant pool by compiler">;
243 def DumpConstPool : Predicate<"Subtarget->dumpConstPool()">,
244 AssemblerPredicate<(all_of FeatureConstPool),
245 "Dump the constant pool by compiler">;
247 def FeatureStackSize : SubtargetFeature<"stack-size", "EnableStackSize", "true",
248 "Output stack size information">;
249 def EnableStackSize : Predicate<"Subtarget->enableStackSize()">,
250 AssemblerPredicate<(all_of FeatureStackSize),
251 "Output stack size information">;
254 : SubtargetFeature<"ccrt", "UseCCRT", "true", "Use CSKY compiler runtime">;
255 def UseCCRT : Predicate<"Subtarget->useCCRT()">,
256 AssemblerPredicate<(all_of FeatureCCRT),
257 "Use CSKY compiler runtime">;
259 def FeatureVDSPV1_128 : SubtargetFeature<"vdspv1", "HasVDSPV1_128", "true",
260 "Enable 128bit vdsp-v1 instructions">;
261 def HasVDSPV1_128 : Predicate<"Subtarget->hasVDSPV1_128()">,
262 AssemblerPredicate<(all_of FeatureVDSPV1_128),
263 "Enable 128bit vdsp-v1 instructions">;
266 : SubtargetFeature<"e1", "HasE1", "true", "Support CSKY e1 instructions",
268 def iHasE1 : Predicate<"Subtarget->hasE1()">,
269 AssemblerPredicate<(all_of HasE1),
270 "Support CSKY e1 instructions">;
273 : SubtargetFeature<"e2", "HasE2", "true", "Support CSKY e2 instructions",
275 def iHasE2 : Predicate<"Subtarget->hasE2()">,
276 AssemblerPredicate<(all_of HasE2),
277 "Support CSKY e2 instructions">;
279 def Has2E3 : SubtargetFeature<"2e3", "Has2E3", "true",
280 "Support CSKY 2e3 instructions", [HasE2]>;
281 def iHas2E3 : Predicate<"Subtarget->has2E3()">,
282 AssemblerPredicate<(all_of Has2E3),
283 "Support CSKY 2e3 instructions">;
285 def HasMP : SubtargetFeature<"mp", "HasMP", "true",
286 "Support CSKY mp instructions", [Has2E3]>;
287 def iHasMP : Predicate<"Subtarget->hasMP()">,
288 AssemblerPredicate<(all_of HasMP),
289 "Support CSKY mp instructions">;
291 def Has3E3r1 : SubtargetFeature<"3e3r1", "Has3E3r1", "true",
292 "Support CSKY 3e3r1 instructions">;
293 def iHas3E3r1 : Predicate<"Subtarget->has3E3r1()">,
294 AssemblerPredicate<(all_of Has3E3r1),
295 "Support CSKY 3e3r1 instructions">;
297 def Has3r1E3r2 : SubtargetFeature<"3e3r2", "Has3r1E3r2", "true",
298 "Support CSKY 3e3r2 instructions",
299 [Has3E3r1, FeatureDoloop]>;
300 def iHas3r1E3r2 : Predicate<"Subtarget->has3r1E3r2()">,
301 AssemblerPredicate<(all_of Has3r1E3r2),
302 "Support CSKY 3e3r2 instructions">;
305 : SubtargetFeature<"3e3r3", "Has3r2E3r3", "true",
306 "Support CSKY 3e3r3 instructions", [FeatureDoloop]>;
307 def iHas3r2E3r3 : Predicate<"Subtarget->has3r2E3r3()">,
308 AssemblerPredicate<(all_of Has3r2E3r3),
309 "Support CSKY 3e3r3 instructions">;
311 def Has3E7 : SubtargetFeature<"3e7", "Has3E7", "true",
312 "Support CSKY 3e7 instructions", [Has2E3]>;
313 def iHas3E7 : Predicate<"Subtarget->has3E7()">,
314 AssemblerPredicate<(all_of Has3E7),
315 "Support CSKY 3e7 instructions">;
317 def HasMP1E2 : SubtargetFeature<"mp1e2", "HasMP1E2", "true",
318 "Support CSKY mp1e2 instructions", [Has3E7]>;
319 def iHasMP1E2 : Predicate<"Subtarget->hasMP1E2()">,
320 AssemblerPredicate<(all_of HasMP1E2),
321 "Support CSKY mp1e2 instructions">;
323 def Has7E10 : SubtargetFeature<"7e10", "Has7E10", "true",
324 "Support CSKY 7e10 instructions", [Has3E7]>;
325 def iHas7E10 : Predicate<"Subtarget->has7E10()">,
326 AssemblerPredicate<(all_of Has7E10),
327 "Support CSKY 7e10 instructions">;
329 def Has10E60 : SubtargetFeature<"10e60", "Has10E60", "true",
330 "Support CSKY 10e60 instructions", [Has7E10]>;
331 def iHas10E60 : Predicate<"Subtarget->has10E60()">,
332 AssemblerPredicate<(all_of Has10E60),
333 "Support CSKY 10e60 instructions">;
335 //===----------------------------------------------------------------------===//
336 // CSKY Processor subtarget features.
337 //===----------------------------------------------------------------------===//
339 def ProcCK801 : SubtargetFeature<"ck801", "CSKYProcFamily", "CK801",
340 "CSKY ck801 processors", []>;
341 def isCK801 : Predicate<"Subtarget->isCK801()">,
342 AssemblerPredicate<(all_of ProcCK801)>;
343 def ProcCK802 : SubtargetFeature<"ck802", "CSKYProcFamily", "CK802",
344 "CSKY ck802 processors", []>;
345 def ProcCK803 : SubtargetFeature<"ck803", "CSKYProcFamily", "CK803",
346 "CSKY ck803 processors", []>;
347 def ProcCK803S : SubtargetFeature<"ck803s", "CSKYProcFamily", "CK803S",
348 "CSKY ck803s processors", []>;
349 def ProcCK804 : SubtargetFeature<"ck804", "CSKYProcFamily", "CK804",
350 "CSKY ck804 processors", []>;
351 def ProcCK805 : SubtargetFeature<"ck805", "CSKYProcFamily", "CK805",
352 "CSKY ck805 processors", []>;
353 def ProcCK807 : SubtargetFeature<"ck807", "CSKYProcFamily", "CK807",
354 "CSKY ck807 processors", []>;
355 def ProcCK810 : SubtargetFeature<"ck810", "CSKYProcFamily", "CK810",
356 "CSKY ck810 processors", []>;
357 def ProcCK810V : SubtargetFeature<"ck810v", "CSKYProcFamily", "CK810V",
358 "CSKY ck810v processors", []>;
359 def ProcCK860 : SubtargetFeature<"ck860", "CSKYProcFamily", "CK860",
360 "CSKY ck860 processors", []>;
361 def ProcCK860V : SubtargetFeature<"ck860v", "CSKYProcFamily", "CK860V",
362 "CSKY ck860v processors", []>;
364 //===----------------------------------------------------------------------===//
365 // Registers, calling conventions, instruction descriptions.
366 //===----------------------------------------------------------------------===//
368 include "CSKYRegisterInfo.td"
369 include "CSKYCallingConv.td"
370 include "CSKYInstrInfo.td"
372 //===----------------------------------------------------------------------===//
373 // CSKY processors supported.
374 //===----------------------------------------------------------------------===//
376 // btsti16 is one of most basic instructions should be enable
377 // even in generic processor to avoid failure codegen.
378 def : ProcessorModel<"generic", NoSchedModel, [FeatureBTST16]>;
381 class CK801<string n, SchedMachineModel m, list<SubtargetFeature> f,
382 list<SubtargetFeature> tunef = []>
383 : ProcessorModel<n, m, !listconcat(f, [HasE1, FeatureTrust, FeatureBTST16, ProcCK801]), !listconcat(tunef, [])>;
385 def : CK801<"ck801", NoSchedModel, []>;
386 def : CK801<"ck801t", NoSchedModel, []>;
387 def : CK801<"e801", NoSchedModel, []>;
390 class CK802<string n, SchedMachineModel m, list<SubtargetFeature> f,
391 list<SubtargetFeature> tunef = []>
392 : ProcessorModel<n, m, !listconcat(f, [HasE2, FeatureTrust, FeatureBTST16, FeatureNVIC, ProcCK802]), !listconcat(tunef, [])>;
394 def : CK802<"ck802", NoSchedModel, []>;
395 def : CK802<"ck802t", NoSchedModel, []>;
396 def : CK802<"ck802j", NoSchedModel, [FeatureJAVA]>;
397 def : CK802<"e802", NoSchedModel, []>;
398 def : CK802<"e802t", NoSchedModel, []>;
399 def : CK802<"s802", NoSchedModel, []>;
400 def : CK802<"s802t", NoSchedModel, []>;
403 class CK803<string n, SchedMachineModel m, list<SubtargetFeature> f,
404 list<SubtargetFeature> tunef = []>
405 : ProcessorModel<n, m, !listconcat(f, [Has2E3, HasMP, FeatureTrust, FeatureBTST16, FeatureNVIC, FeatureHWDiv, ProcCK803]), !listconcat(tunef, [])>;
407 def : CK803<"ck803", NoSchedModel, []>;
408 def : CK803<"ck803h", NoSchedModel, []>;
409 def : CK803<"ck803t", NoSchedModel, []>;
410 def : CK803<"ck803ht", NoSchedModel, []>;
411 def : CK803<"ck803f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
412 def : CK803<"ck803fh", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
413 def : CK803<"ck803e", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>;
414 def : CK803<"ck803eh", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>;
415 def : CK803<"ck803et", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>;
416 def : CK803<"ck803eht", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>;
417 def : CK803<"ck803ef", NoSchedModel,
418 [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
419 def : CK803<"ck803efh", NoSchedModel,
420 [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
421 def : CK803<"ck803ft", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
422 def : CK803<"ck803eft", NoSchedModel,
423 [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
424 def : CK803<"ck803efht", NoSchedModel,
425 [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
426 def : CK803<"ck803r1", NoSchedModel, [Has3E3r1, Has3r2E3r3, FeatureDSPV2]>;
427 def : CK803<"ck803hr1", NoSchedModel, [Has3E3r1, Has3r2E3r3, FeatureDSPV2]>;
428 def : CK803<"ck803tr1", NoSchedModel, [Has3E3r1, Has3r2E3r3, FeatureDSPV2]>;
429 def : CK803<"ck803htr1", NoSchedModel, [Has3E3r1, Has3r2E3r3, FeatureDSPV2]>;
430 def : CK803<"ck803fr1", NoSchedModel,
431 [Has3E3r1, Has3r2E3r3, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureDSPV2]>;
432 def : CK803<"ck803fhr1", NoSchedModel,
433 [Has3E3r1, Has3r2E3r3, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureDSPV2]>;
434 def : CK803<"ck803er1", NoSchedModel,
435 [Has3E3r1, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
436 def : CK803<"ck803etr1", NoSchedModel,
437 [Has3E3r1, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
438 def : CK803<"ck803ehr1", NoSchedModel,
439 [Has3E3r1, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
440 def : CK803<"ck803ehtr1", NoSchedModel,
441 [Has3E3r1, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
442 def : CK803<"ck803efr1", NoSchedModel,
443 [Has3E3r1, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
444 def : CK803<"ck803efhr1", NoSchedModel,
445 [Has3E3r1, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
446 def : CK803<"ck803ftr1", NoSchedModel, [Has3E3r1, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureDSPV2]>;
447 def : CK803<"ck803eftr1", NoSchedModel,
448 [Has3E3r1, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
449 def : CK803<"ck803efhtr1", NoSchedModel,
450 [Has3E3r1, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
451 def : CK803<"ck803r2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>;
452 def : CK803<"ck803hr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>;
453 def : CK803<"ck803tr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>;
454 def : CK803<"ck803htr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>;
455 def : CK803<"ck803fr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
456 def : CK803<"ck803fhr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
457 def : CK803<"ck803er2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
458 def : CK803<"ck803etr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
459 def : CK803<"ck803ehr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
460 def : CK803<"ck803ehtr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
461 def : CK803<"ck803efr2", NoSchedModel,
462 [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
463 def : CK803<"ck803efhr2", NoSchedModel,
464 [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
465 def : CK803<"ck803ftr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
466 def : CK803<"ck803eftr2", NoSchedModel,
467 [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
468 def : CK803<"ck803efhtr2", NoSchedModel,
469 [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
470 def : CK803<"ck803r3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>;
471 def : CK803<"ck803hr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>;
472 def : CK803<"ck803tr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>;
473 def : CK803<"ck803htr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>;
474 def : CK803<"ck803fr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
475 def : CK803<"ck803fhr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
476 def : CK803<"ck803er3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
477 def : CK803<"ck803etr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
478 def : CK803<"ck803ehr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
479 def : CK803<"ck803ehtr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>;
480 def : CK803<"ck803efr3", NoSchedModel,
481 [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
482 def : CK803<"ck803efhr3", NoSchedModel,
483 [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
484 def : CK803<"ck803ftr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
485 def : CK803<"ck803eftr3", NoSchedModel,
486 [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
487 def : CK803<"ck803efhtr3", NoSchedModel,
488 [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
489 def : CK803<"s803", NoSchedModel, [Has3r1E3r2, Has3r2E3r3]>;
490 def : CK803<"s803t", NoSchedModel, [Has3r1E3r2, Has3r2E3r3]>;
491 def : CK803<"e803", NoSchedModel, [Has3r1E3r2, Has3r2E3r3]>;
492 def : CK803<"e803t", NoSchedModel, [Has3r1E3r2, Has3r2E3r3]>;
495 class CK803S<string n, SchedMachineModel m, list<SubtargetFeature> f,
496 list<SubtargetFeature> tunef = []> : CK803<n, m, !listconcat(f, [Has3E3r1, ProcCK803S]), tunef>;
498 def : CK803S<"ck803s", NoSchedModel, []>;
499 def : CK803S<"ck803sn", NoSchedModel, [FeatureDSP_Silan]>;
500 def : CK803S<"ck803st", NoSchedModel, []>;
501 def : CK803S<"ck803snt", NoSchedModel, [FeatureDSP_Silan]>;
502 def : CK803S<"ck803sf", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
503 def : CK803S<"ck803sfn", NoSchedModel, [FeatureFPUV2_SF, FeatureDSP_Silan, HasFLOATE1, HasFLOAT1E3]>;
504 def : CK803S<"ck803se", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>;
505 def : CK803S<"ck803sen", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSP_Silan]>;
506 def : CK803S<"ck803sef", NoSchedModel,
507 [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
508 def : CK803S<"ck803sefn", NoSchedModel,
509 [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, FeatureDSP_Silan,
510 HasFLOATE1, HasFLOAT1E3]>;
511 def : CK803S<"ck803seft", NoSchedModel,
512 [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
513 def : CK803S<"ck803sefnt", NoSchedModel,
514 [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, FeatureDSP_Silan,
515 HasFLOATE1, HasFLOAT1E3]>;
518 class CK804<string n, SchedMachineModel m, list<SubtargetFeature> f,
519 list<SubtargetFeature> tunef = []>
520 : CK803<n, m, !listconcat(f, [Has3r1E3r2, Has3r2E3r3, ProcCK804]), !listconcat(tunef, [])>;
522 def : CK804<"ck804", NoSchedModel, []>;
523 def : CK804<"ck804h", NoSchedModel, []>;
524 def : CK804<"ck804t", NoSchedModel, []>;
525 def : CK804<"ck804ht", NoSchedModel, []>;
526 def : CK804<"ck804f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
527 def : CK804<"ck804fh", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
528 def : CK804<"ck804e", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>;
529 def : CK804<"ck804et", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>;
530 def : CK804<"ck804eh", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>;
531 def : CK804<"ck804eht", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>;
532 def : CK804<"ck804ef", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
533 def : CK804<"ck804efh", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
534 def : CK804<"ck804ft", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
535 def : CK804<"ck804eft", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
536 def : CK804<"ck804efht", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
537 def : CK804<"e804d", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>;
538 def : CK804<"e804dt", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>;
539 def : CK804<"e804f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
540 def : CK804<"e804ft", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
541 def : CK804<"e804df", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
542 def : CK804<"e804dft", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>;
545 class CK805<string n, SchedMachineModel m, list<SubtargetFeature> f,
546 list<SubtargetFeature> tunef = []>
547 : CK803<n, m, !listconcat(f, [FeatureHighreg, FeatureVDSPV2, HasVDSP2E3, Has3r1E3r2, Has3r2E3r3, ProcCK805]),
548 !listconcat(tunef, [])>;
550 def : CK805<"ck805", NoSchedModel, []>;
551 def : CK805<"i805", NoSchedModel, []>;
552 def : CK805<"ck805t", NoSchedModel, []>;
553 def : CK805<"i805f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
554 def : CK805<"ck805f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
555 def : CK805<"ck805e", NoSchedModel, [FeatureDSPV2]>;
556 def : CK805<"ck805ef", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
557 def : CK805<"ck805et", NoSchedModel, [FeatureDSPV2]>;
558 def : CK805<"ck805ft", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
559 def : CK805<"ck805eft", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>;
562 class CK807<string n, SchedMachineModel m, list<SubtargetFeature> f,
563 list<SubtargetFeature> tunef = []>
564 : ProcessorModel<n, m, !listconcat(f,
565 [ Has3E7, HasMP, HasMP1E2, FeatureTrust, FeatureHWDiv, FeatureDSP, HasDSP1E2, HasDSPE60,
566 FeatureHighreg, FeatureHardTP, FeatureNVIC, FeatureCache, ProcCK807]), !listconcat(tunef, [])>;
568 def : CK807<"ck807", NoSchedModel, []>;
569 def : CK807<"c807", NoSchedModel, []>;
570 def : CK807<"r807", NoSchedModel, []>;
571 def : CK807<"ck807e", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>;
572 def : CK807<"ck807f", NoSchedModel,
573 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
574 HasFLOATE1, HasFLOAT1E2, HasFLOAT1E3, HasFLOAT3E4]>;
575 def : CK807<"c807f", NoSchedModel,
576 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
577 HasFLOATE1, HasFLOAT1E2, HasFLOAT1E3, HasFLOAT3E4]>;
578 def : CK807<"r807f", NoSchedModel,
579 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
580 HasFLOATE1, HasFLOAT1E2, HasFLOAT1E3, HasFLOAT3E4]>;
581 def : CK807<"ck807ef", NoSchedModel, [
582 FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, FeatureFPUV2_DF,
583 FeatureFdivdu, HasFLOATE1, HasFLOAT1E2, HasFLOAT1E3, HasFLOAT3E4]>;
586 class CK810<string n, SchedMachineModel m, list<SubtargetFeature> f,
587 list<SubtargetFeature> tunef = []>
588 : ProcessorModel<n, m, !listconcat(f,
589 [ Has7E10, HasMP, HasMP1E2, FeatureTrust, FeatureHWDiv, FeatureDSP, HasDSP1E2, HasDSPE60,
590 FeatureHighreg, FeatureHardTP, FeatureNVIC, FeatureCache, ProcCK810]), !listconcat(tunef, [])>;
592 def : CK810<"ck810", NoSchedModel, []>;
593 def : CK810<"ck810e", NoSchedModel, []>;
594 def : CK810<"ck810t", NoSchedModel, []>;
595 def : CK810<"ck810et", NoSchedModel, []>;
596 def : CK810<"c810", NoSchedModel,
597 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
598 HasFLOATE1, HasFLOAT1E2]>;
599 def : CK810<"ck810f", NoSchedModel,
600 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
601 HasFLOATE1, HasFLOAT1E2]>;
602 def : CK810<"ck810ef", NoSchedModel,
603 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
604 HasFLOATE1, HasFLOAT1E2]>;
605 def : CK810<"ck810ft", NoSchedModel,
606 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
607 HasFLOATE1, HasFLOAT1E2]>;
608 def : CK810<"ck810eft", NoSchedModel,
609 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
610 HasFLOATE1, HasFLOAT1E2]>;
611 def : CK810<"c810t", NoSchedModel,
612 [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
613 HasFLOATE1, HasFLOAT1E2]>;
615 class CK810V<string n, SchedMachineModel m, list<SubtargetFeature> f,
616 list<SubtargetFeature> tunef = []>
617 : CK810<n, m, !listconcat(f, [FeatureVDSPV1_128, ProcCK810V]), !listconcat(tunef, [])>;
619 def : CK810V<"ck810v", NoSchedModel, []>;
620 def : CK810V<"ck810ev", NoSchedModel, []>;
621 def : CK810V<"ck810tv", NoSchedModel, []>;
622 def : CK810V<"ck810etv", NoSchedModel, []>;
623 def : CK810V<"ck810fv", NoSchedModel, [
624 FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
625 HasFLOATE1, HasFLOAT1E2
627 def : CK810V<"ck810efv", NoSchedModel, [
628 FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
629 HasFLOATE1, HasFLOAT1E2
631 def : CK810V<"c810v", NoSchedModel, [
632 FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
633 HasFLOATE1, HasFLOAT1E2
635 def : CK810V<"ck810ftv", NoSchedModel, [
636 FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
637 HasFLOATE1, HasFLOAT1E2
639 def : CK810V<"ck810eftv", NoSchedModel, [
640 FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
641 HasFLOATE1, HasFLOAT1E2
643 def : CK810V<"c810tv", NoSchedModel, [
644 FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu,
645 HasFLOATE1, HasFLOAT1E2
649 class CK860<string n, SchedMachineModel m, list<SubtargetFeature> f,
650 list<SubtargetFeature> tunef = []>
651 : ProcessorModel<n, m, !listconcat(f,
652 [ Has10E60, HasMP, HasMP1E2, Has3r1E3r2, Has3r2E3r3, FeatureTrust, FeatureBTST16, FeatureHWDiv, HasDSPE60,
653 FeatureHighreg, FeatureHardTP, FeatureNVIC, FeatureCache, ProcCK860]), !listconcat(tunef, [])>;
655 class CK860V<string n, SchedMachineModel m, list<SubtargetFeature> f,
656 list<SubtargetFeature> tunef = []>
657 : CK860<n, m, !listconcat(f, [FeatureVDSPV2, HasVDSP2E60F, ProcCK860V]), !listconcat(tunef, [])>;
659 def : CK860<"ck860", NoSchedModel, []>;
660 def : CK860<"ck860f", NoSchedModel,
661 [FeatureFPUV3_HI, FeatureFPUV3_HF, FeatureFPUV3_SF, FeatureFPUV3_DF, HasFLOAT7E60]>;
662 def : CK860<"c860", NoSchedModel,
663 [FeatureFPUV3_HI, FeatureFPUV3_HF, FeatureFPUV3_SF, FeatureFPUV3_DF, HasFLOAT7E60]>;
664 def : CK860V<"c860v", NoSchedModel,
665 [FeatureFPUV3_HI, FeatureFPUV3_HF, FeatureFPUV3_SF, FeatureFPUV3_DF, HasFLOAT7E60]>;
666 def : CK860V<"ck860v", NoSchedModel, []>;
667 def : CK860V<"ck860fv", NoSchedModel,
668 [FeatureFPUV3_HI, FeatureFPUV3_HF, FeatureFPUV3_SF, FeatureFPUV3_DF, HasFLOAT7E60]>;
670 //===----------------------------------------------------------------------===//
671 // Define the CSKY target.
672 //===----------------------------------------------------------------------===//
674 def CSKYInstrInfo : InstrInfo;
677 def CSKYAsmParser : AsmParser {
678 let ShouldEmitMatchRegisterAltName = 1;
679 let AllowDuplicateRegisterNames = 1;
682 def CSKYAsmWriter : AsmWriter {
683 int PassSubtarget = 1;
687 let InstructionSet = CSKYInstrInfo;
688 let AssemblyParsers = [CSKYAsmParser];
689 let AssemblyWriters = [CSKYAsmWriter];
690 let AllowRegisterRenaming = 1;