1e8d8bef9SDimitry Andric//===-- CSKY.td - Describe the CSKY Target Machine ---------*- tablegen -*-===// 2e8d8bef9SDimitry Andric// 3e8d8bef9SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4e8d8bef9SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 5e8d8bef9SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6e8d8bef9SDimitry Andric// 7e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===// 8e8d8bef9SDimitry Andric 9e8d8bef9SDimitry Andricinclude "llvm/Target/Target.td" 10e8d8bef9SDimitry Andric 11e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===// 12349cc55cSDimitry Andric// CSKY subtarget features and instruction predicates. 13349cc55cSDimitry Andric//===----------------------------------------------------------------------===// 1404eeddc0SDimitry Andricdef ModeHardFloat : 1504eeddc0SDimitry Andric SubtargetFeature<"hard-float", "UseHardFloat", 1604eeddc0SDimitry Andric "true", "Use hard floating point features">; 1704eeddc0SDimitry Andricdef ModeHardFloatABI : 1804eeddc0SDimitry Andric SubtargetFeature<"hard-float-abi", "UseHardFloatABI", 1904eeddc0SDimitry Andric "true", "Use hard floating point ABI to pass args">; 2004eeddc0SDimitry Andric 2104eeddc0SDimitry Andricdef FeatureFPUV2_SF 2204eeddc0SDimitry Andric : SubtargetFeature<"fpuv2_sf", "HasFPUv2SingleFloat", "true", 2304eeddc0SDimitry Andric "Enable FPUv2 single float instructions">; 2404eeddc0SDimitry Andricdef HasFPUv2_SF : Predicate<"Subtarget->hasFPUv2SingleFloat()">, 2504eeddc0SDimitry Andric AssemblerPredicate<(all_of FeatureFPUV2_SF), 2604eeddc0SDimitry Andric "Enable FPUv2 single float instructions">; 2704eeddc0SDimitry Andric 2804eeddc0SDimitry Andricdef FeatureFPUV2_DF 2904eeddc0SDimitry Andric : SubtargetFeature<"fpuv2_df", "HasFPUv2DoubleFloat", "true", 3004eeddc0SDimitry Andric "Enable FPUv2 double float instructions">; 3104eeddc0SDimitry Andricdef HasFPUv2_DF : Predicate<"Subtarget->hasFPUv2DoubleFloat()">, 3204eeddc0SDimitry Andric AssemblerPredicate<(all_of FeatureFPUV2_DF), 3304eeddc0SDimitry Andric "Enable FPUv2 double float instructions">; 3404eeddc0SDimitry Andric 3581ad6265SDimitry Andricdef FeatureFdivdu : SubtargetFeature<"fdivdu", "HasFdivdu", "true", 3681ad6265SDimitry Andric "Enable float divide instructions">; 3781ad6265SDimitry Andricdef HasFdivdu : Predicate<"Subtarget->hasFdivdu()">, 3881ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureFdivdu), 3981ad6265SDimitry Andric "Enable float divide instructions">; 4081ad6265SDimitry Andric 4181ad6265SDimitry Andricdef FeatureFPUV3_HI 4281ad6265SDimitry Andric : SubtargetFeature<"fpuv3_hi", "HasFPUv3HalfWord", "true", 43*06c3fb27SDimitry Andric "Enable FPUv3 half word converting instructions">; 4481ad6265SDimitry Andricdef HasFPUv3_HI : Predicate<"Subtarget->hasFPUv3HalfWord()">, 4581ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureFPUV3_HI), 46*06c3fb27SDimitry Andric "Enable FPUv3 half word converting instructions">; 4781ad6265SDimitry Andric 4881ad6265SDimitry Andricdef FeatureFPUV3_HF 4981ad6265SDimitry Andric : SubtargetFeature<"fpuv3_hf", "HasFPUv3HalfFloat", "true", 50*06c3fb27SDimitry Andric "Enable FPUv3 half precision operate instructions">; 5181ad6265SDimitry Andricdef HasFPUv3_HF : Predicate<"Subtarget->hasFPUv3HalfFloat()">, 5281ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureFPUV3_HF), 53*06c3fb27SDimitry Andric "Enable FPUv3 half precision operate instructions">; 5481ad6265SDimitry Andric 5504eeddc0SDimitry Andricdef FeatureFPUV3_SF 5604eeddc0SDimitry Andric : SubtargetFeature<"fpuv3_sf", "HasFPUv3SingleFloat", "true", 5704eeddc0SDimitry Andric "Enable FPUv3 single float instructions">; 5804eeddc0SDimitry Andricdef HasFPUv3_SF : Predicate<"Subtarget->hasFPUv3SingleFloat()">, 5904eeddc0SDimitry Andric AssemblerPredicate<(all_of FeatureFPUV3_SF), 6004eeddc0SDimitry Andric "Enable FPUv3 single float instructions">; 6104eeddc0SDimitry Andric 6204eeddc0SDimitry Andricdef FeatureFPUV3_DF 6304eeddc0SDimitry Andric : SubtargetFeature<"fpuv3_df", "HasFPUv3DoubleFloat", "true", 6404eeddc0SDimitry Andric "Enable FPUv3 double float instructions">; 6504eeddc0SDimitry Andricdef HasFPUv3_DF : Predicate<"Subtarget->hasFPUv3DoubleFloat()">, 6604eeddc0SDimitry Andric AssemblerPredicate<(all_of FeatureFPUV3_DF), 6704eeddc0SDimitry Andric "Enable FPUv3 double float instructions">; 68349cc55cSDimitry Andric 6981ad6265SDimitry Andricdef HasFLOATE1 7081ad6265SDimitry Andric : SubtargetFeature<"floate1", "HasFLOATE1", "true", "Support CSKY floate1 instructions">; 7181ad6265SDimitry Andricdef iHasFLOATE1 : Predicate<"Subtarget->hasFLOATE1()">, 7281ad6265SDimitry Andric AssemblerPredicate<(all_of HasFLOATE1), 7381ad6265SDimitry Andric "Support CSKY floate1 instructions">; 7481ad6265SDimitry Andric 7581ad6265SDimitry Andricdef HasFLOAT1E2 7681ad6265SDimitry Andric : SubtargetFeature<"float1e2", "HasFLOAT1E2", "true", "Support CSKY float1e2 instructions">; 7781ad6265SDimitry Andricdef iHasFLOAT1E2 : Predicate<"Subtarget->hasFLOAT1E2()">, 7881ad6265SDimitry Andric AssemblerPredicate<(all_of HasFLOAT1E2), 7981ad6265SDimitry Andric "Support CSKY float1e2 instructions">; 8081ad6265SDimitry Andric 8181ad6265SDimitry Andricdef HasFLOAT1E3 8281ad6265SDimitry Andric : SubtargetFeature<"float1e3", "HasFLOAT1E3", "true", "Support CSKY float1e3 instructions">; 8381ad6265SDimitry Andricdef iHasFLOAT1E3 : Predicate<"Subtarget->hasFLOAT1E3()">, 8481ad6265SDimitry Andric AssemblerPredicate<(all_of HasFLOAT1E3), 8581ad6265SDimitry Andric "Support CSKY float1e3 instructions">; 8681ad6265SDimitry Andric 8781ad6265SDimitry Andricdef HasFLOAT3E4 8881ad6265SDimitry Andric : SubtargetFeature<"float3e4", "HasFLOAT3E4", "true", "Support CSKY float3e4 instructions">; 8981ad6265SDimitry Andricdef iHasFLOAT3E4 : Predicate<"Subtarget->hasFLOAT3E4()">, 9081ad6265SDimitry Andric AssemblerPredicate<(all_of HasFLOAT3E4), 9181ad6265SDimitry Andric "Support CSKY float3e4 instructions">; 9281ad6265SDimitry Andric 9381ad6265SDimitry Andricdef HasFLOAT7E60 9481ad6265SDimitry Andric : SubtargetFeature<"float7e60", "HasFLOAT7E60", "true", "Support CSKY float7e60 instructions">; 9581ad6265SDimitry Andricdef iHasFLOAT7E60 : Predicate<"Subtarget->hasFLOAT7E60()">, 9681ad6265SDimitry Andric AssemblerPredicate<(all_of HasFLOAT7E60), 9781ad6265SDimitry Andric "Support CSKY float7e60 instructions">; 9881ad6265SDimitry Andric 9981ad6265SDimitry Andricdef FeatureHWDiv : SubtargetFeature<"hwdiv", "HasHardwareDivide", "true", 10081ad6265SDimitry Andric "Enable divide instrutions">; 10181ad6265SDimitry Andricdef HasHWDiv : Predicate<"Subtarget->hasHardwareDivide()">, 10281ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureHWDiv), 10381ad6265SDimitry Andric "Enable divide instrutions">; 10481ad6265SDimitry Andric 10581ad6265SDimitry Andricdef FeatureSTM : SubtargetFeature<"multiple_stld", "HasSTM", "true", 10681ad6265SDimitry Andric "Enable multiple load/store instrutions">; 10781ad6265SDimitry Andricdef HasSTM : Predicate<"Subtarget->hasSTM()">, 10881ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureSTM), 10981ad6265SDimitry Andric "Enable multiple load/store instrutions">; 11081ad6265SDimitry Andric 11181ad6265SDimitry Andricdef FeaturePushPop : SubtargetFeature<"pushpop", "HasPushPop", "true", 11281ad6265SDimitry Andric "Enable push/pop instrutions">; 11381ad6265SDimitry Andricdef HasPushPop : Predicate<"Subtarget->hasPushPop()">, 11481ad6265SDimitry Andric AssemblerPredicate<(all_of FeaturePushPop), 11581ad6265SDimitry Andric "Enable push/pop instrutions">; 11681ad6265SDimitry Andric 11781ad6265SDimitry Andricdef FeatureDSP 11881ad6265SDimitry Andric : SubtargetFeature<"edsp", "HasDSP", "true", "Enable DSP instrutions">; 11981ad6265SDimitry Andricdef HasDSP : Predicate<"Subtarget->hasDSP()">, 12081ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureDSP), 12181ad6265SDimitry Andric "Enable DSP instrutions">; 12281ad6265SDimitry Andric 12381ad6265SDimitry Andricdef HasDSP1E2 12481ad6265SDimitry Andric : SubtargetFeature<"dsp1e2", "HasDSP1E2", "true", "Support CSKY dsp1e2 instructions">; 12581ad6265SDimitry Andricdef iHasDSP1E2 : Predicate<"Subtarget->hasDSP1E2()">, 12681ad6265SDimitry Andric AssemblerPredicate<(all_of HasDSP1E2), 12781ad6265SDimitry Andric "Support CSKY dsp1e2 instructions">; 12881ad6265SDimitry Andric 12981ad6265SDimitry Andricdef HasDSPE60 13081ad6265SDimitry Andric : SubtargetFeature<"dspe60", "HasDSPE60", "true", "Support CSKY dspe60 instructions">; 13181ad6265SDimitry Andricdef iHasDSPE60 : Predicate<"Subtarget->hasDSPE60()">, 13281ad6265SDimitry Andric AssemblerPredicate<(all_of HasDSPE60), 13381ad6265SDimitry Andric "Support CSKY dspe60 instructions">; 13481ad6265SDimitry Andric 13581ad6265SDimitry Andricdef FeatureDSPV2 : SubtargetFeature<"dspv2", "HasDSPV2", "true", 13681ad6265SDimitry Andric "Enable DSP V2.0 instrutions">; 13781ad6265SDimitry Andricdef HasDSPV2 : Predicate<"Subtarget->hasDSPV2()">, 13881ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureDSPV2), 13981ad6265SDimitry Andric "Enable DSP V2.0 instrutions">; 14081ad6265SDimitry Andric 14181ad6265SDimitry Andricdef FeatureDSP_Silan : SubtargetFeature<"dsp_silan", "HasDSP_Silan", "true", 14281ad6265SDimitry Andric "Enable DSP Silan instrutions">; 14381ad6265SDimitry Andricdef HasDSP_Silan : Predicate<"Subtarget->hasDSP_Silan()">, 14481ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureDSP_Silan), 14581ad6265SDimitry Andric "Enable DSP Silan instrutions">; 14681ad6265SDimitry Andric 14781ad6265SDimitry Andric// Atomic Support 148349cc55cSDimitry Andricdef FeatureBTST16 : SubtargetFeature<"btst16", "HasBTST16", "true", 149349cc55cSDimitry Andric "Use the 16-bit btsti instruction">; 150349cc55cSDimitry Andricdef HasBTST16 : Predicate<"Subtarget->hasBTST16()">, 151349cc55cSDimitry Andric AssemblerPredicate<(all_of FeatureBTST16), 152349cc55cSDimitry Andric "Use the 16-bit btsti instruction">; 153349cc55cSDimitry Andric 154349cc55cSDimitry Andric// Atomic Support 155349cc55cSDimitry Andricdef FeatureExtendLrw : SubtargetFeature<"elrw", "HasExtendLrw", "true", 156349cc55cSDimitry Andric "Use the extend LRW instruction">; 157349cc55cSDimitry Andricdef HasExtendLrw : Predicate<"Subtarget->hasExtendLrw()">, 158349cc55cSDimitry Andric AssemblerPredicate<(all_of FeatureExtendLrw), 159349cc55cSDimitry Andric "Use the extend LRW instruction">; 160349cc55cSDimitry Andric 16181ad6265SDimitry Andricdef FeatureTrust : SubtargetFeature<"trust", "HasTrust", "true", 16281ad6265SDimitry Andric "Enable trust instructions">; 16381ad6265SDimitry Andricdef HasTrust : Predicate<"Subtarget->hasTrust()">, 16481ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureTrust), 16581ad6265SDimitry Andric "Enable trust instructions">; 16681ad6265SDimitry Andric 167349cc55cSDimitry Andricdef FeatureJAVA 168349cc55cSDimitry Andric : SubtargetFeature<"java", "HasJAVA", "true", "Enable java instructions">; 169349cc55cSDimitry Andricdef HasJAVA : Predicate<"Subtarget->hasJAVA()">, 170349cc55cSDimitry Andric AssemblerPredicate<(all_of FeatureJAVA), 171349cc55cSDimitry Andric "Enable java instructions">; 172349cc55cSDimitry Andric 17381ad6265SDimitry Andricdef FeatureCache 17481ad6265SDimitry Andric : SubtargetFeature<"cache", "HasCache", "true", "Enable cache">; 17581ad6265SDimitry Andricdef HasCache : Predicate<"Subtarget->hasCache()">, 17681ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureCache), 17781ad6265SDimitry Andric "Enable cache">; 17881ad6265SDimitry Andric 17981ad6265SDimitry Andricdef FeatureNVIC 18081ad6265SDimitry Andric : SubtargetFeature<"nvic", "HasNVIC", "true", "Enable NVIC">; 18181ad6265SDimitry Andricdef HasNVIC : Predicate<"Subtarget->hasNVIC()">, 18281ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureNVIC), 18381ad6265SDimitry Andric "Enable NVIC">; 18481ad6265SDimitry Andric 185349cc55cSDimitry Andricdef FeatureDoloop : SubtargetFeature<"doloop", "HasDoloop", "true", 186349cc55cSDimitry Andric "Enable doloop instructions">; 187349cc55cSDimitry Andricdef HasDoloop : Predicate<"Subtarget->hasDoloop()">, 188349cc55cSDimitry Andric AssemblerPredicate<(all_of FeatureDoloop), 189349cc55cSDimitry Andric "Enable doloop instructions">; 190349cc55cSDimitry Andric 19181ad6265SDimitry Andric// Other features than instructions 19281ad6265SDimitry Andricdef FeatureHighreg : SubtargetFeature<"high-registers", "HasHighRegisters", 19381ad6265SDimitry Andric "true", "Enable r16-r31 registers">; 19481ad6265SDimitry Andricdef HasHighRegisters : Predicate<"Subtarget->hasHighRegisters()">, 19581ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureHighreg), 19681ad6265SDimitry Andric "Enable r16-r31 registers">; 19781ad6265SDimitry Andric 19881ad6265SDimitry Andricdef FeatureSmart : SubtargetFeature<"smart", "SmartMode", "true", 19981ad6265SDimitry Andric "Let CPU work in Smart Mode">; 20081ad6265SDimitry Andricdef SmartMode : Predicate<"Subtarget->smartMode()">, 20181ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureSmart), 20281ad6265SDimitry Andric "Let CPU work in Smart Mode">; 20381ad6265SDimitry Andric 20481ad6265SDimitry Andricdef FeatureVDSPV2 : SubtargetFeature<"vdspv2", "HasVDSPV2", "true", 20581ad6265SDimitry Andric "Enable vdsp-v2 instructions">; 20681ad6265SDimitry Andricdef HasVDSPV2 : Predicate<"Subtarget->hasVDSPV2()">, 20781ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureVDSPV2), 20881ad6265SDimitry Andric "Enable vdsp-v2 instructions">; 20981ad6265SDimitry Andric 21081ad6265SDimitry Andricdef HasVDSPV2_FLOAT : Predicate<"Subtarget->hasVDSPV2_FLOAT()">; 21181ad6265SDimitry Andricdef HasVDSPV2_HALF: Predicate<"Subtarget->hasVDSPV2_HALF()">; 21281ad6265SDimitry Andric 21381ad6265SDimitry Andricdef HasVDSP2E3 21481ad6265SDimitry Andric : SubtargetFeature<"vdsp2e3", "HasVDSP2E3", "true", "Support CSKY vdsp2e3 instructions">; 21581ad6265SDimitry Andricdef iHasVDSP2E3 : Predicate<"Subtarget->hasVDSP2E3()">, 21681ad6265SDimitry Andric AssemblerPredicate<(all_of HasVDSP2E3), 21781ad6265SDimitry Andric "Support CSKY vdsp2e3 instructions">; 21881ad6265SDimitry Andric 21981ad6265SDimitry Andricdef HasVDSP2E60F 22081ad6265SDimitry Andric : SubtargetFeature<"vdsp2e60f", "HasVDSP2E60F", "true", "Support CSKY vdsp2e60f instructions">; 22181ad6265SDimitry Andricdef iHasVDSP2E60F : Predicate<"Subtarget->hasVDSP2E60F()">, 22281ad6265SDimitry Andric AssemblerPredicate<(all_of HasVDSP2E60F), 22381ad6265SDimitry Andric "Support CSKY vdsp2e60f instructions">; 22481ad6265SDimitry Andric 22581ad6265SDimitry Andricdef FeatureHardTP : SubtargetFeature<"hard-tp", "ReadTPHard", "true", 22681ad6265SDimitry Andric "Enable TLS Pointer register">; 22781ad6265SDimitry Andricdef ReadTPHard : Predicate<"Subtarget->readTPHard()">, 22881ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureHardTP), 22981ad6265SDimitry Andric "Enable TLS Pointer register">; 23081ad6265SDimitry Andric 23181ad6265SDimitry Andricdef FeatureSoftTP : SubtargetFeature<"soft-tp", "ReadTPHard", "false", 23281ad6265SDimitry Andric "Disable TLS Pointer register">; 23381ad6265SDimitry Andric 23481ad6265SDimitry Andricdef FeatureIstack : SubtargetFeature<"istack", "EnableInterruptAttribute", 23581ad6265SDimitry Andric "true", "Enable interrput attribute">; 23681ad6265SDimitry Andricdef EnableInterruptAttribute 23781ad6265SDimitry Andric : Predicate<"Subtarget->enableInterruptAttribute()">, 23881ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureIstack), 23981ad6265SDimitry Andric "Enable interrput attribute">; 24081ad6265SDimitry Andric 24181ad6265SDimitry Andricdef FeatureConstPool : SubtargetFeature<"constpool", "DumpConstPool", "true", 24281ad6265SDimitry Andric "Dump the constant pool by compiler">; 24381ad6265SDimitry Andricdef DumpConstPool : Predicate<"Subtarget->dumpConstPool()">, 24481ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureConstPool), 24581ad6265SDimitry Andric "Dump the constant pool by compiler">; 24681ad6265SDimitry Andric 24781ad6265SDimitry Andricdef FeatureStackSize : SubtargetFeature<"stack-size", "EnableStackSize", "true", 24881ad6265SDimitry Andric "Output stack size information">; 24981ad6265SDimitry Andricdef EnableStackSize : Predicate<"Subtarget->enableStackSize()">, 25081ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureStackSize), 25181ad6265SDimitry Andric "Output stack size information">; 25281ad6265SDimitry Andric 25381ad6265SDimitry Andricdef FeatureCCRT 25481ad6265SDimitry Andric : SubtargetFeature<"ccrt", "UseCCRT", "true", "Use CSKY compiler runtime">; 25581ad6265SDimitry Andricdef UseCCRT : Predicate<"Subtarget->useCCRT()">, 25681ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureCCRT), 25781ad6265SDimitry Andric "Use CSKY compiler runtime">; 25881ad6265SDimitry Andric 25981ad6265SDimitry Andricdef FeatureVDSPV1_128 : SubtargetFeature<"vdspv1", "HasVDSPV1_128", "true", 26081ad6265SDimitry Andric "Enable 128bit vdsp-v1 instructions">; 26181ad6265SDimitry Andricdef HasVDSPV1_128 : Predicate<"Subtarget->hasVDSPV1_128()">, 26281ad6265SDimitry Andric AssemblerPredicate<(all_of FeatureVDSPV1_128), 26381ad6265SDimitry Andric "Enable 128bit vdsp-v1 instructions">; 26481ad6265SDimitry Andric 265349cc55cSDimitry Andricdef HasE1 266349cc55cSDimitry Andric : SubtargetFeature<"e1", "HasE1", "true", "Support CSKY e1 instructions", 267349cc55cSDimitry Andric [FeatureExtendLrw]>; 268349cc55cSDimitry Andricdef iHasE1 : Predicate<"Subtarget->hasE1()">, 269349cc55cSDimitry Andric AssemblerPredicate<(all_of HasE1), 270349cc55cSDimitry Andric "Support CSKY e1 instructions">; 271349cc55cSDimitry Andric 272349cc55cSDimitry Andricdef HasE2 273349cc55cSDimitry Andric : SubtargetFeature<"e2", "HasE2", "true", "Support CSKY e2 instructions", 274349cc55cSDimitry Andric [HasE1]>; 275349cc55cSDimitry Andricdef iHasE2 : Predicate<"Subtarget->hasE2()">, 276349cc55cSDimitry Andric AssemblerPredicate<(all_of HasE2), 277349cc55cSDimitry Andric "Support CSKY e2 instructions">; 278349cc55cSDimitry Andric 279349cc55cSDimitry Andricdef Has2E3 : SubtargetFeature<"2e3", "Has2E3", "true", 280349cc55cSDimitry Andric "Support CSKY 2e3 instructions", [HasE2]>; 281349cc55cSDimitry Andricdef iHas2E3 : Predicate<"Subtarget->has2E3()">, 282349cc55cSDimitry Andric AssemblerPredicate<(all_of Has2E3), 283349cc55cSDimitry Andric "Support CSKY 2e3 instructions">; 284349cc55cSDimitry Andric 28581ad6265SDimitry Andricdef HasMP : SubtargetFeature<"mp", "HasMP", "true", 28681ad6265SDimitry Andric "Support CSKY mp instructions", [Has2E3]>; 28781ad6265SDimitry Andricdef iHasMP : Predicate<"Subtarget->hasMP()">, 28881ad6265SDimitry Andric AssemblerPredicate<(all_of HasMP), 28981ad6265SDimitry Andric "Support CSKY mp instructions">; 29081ad6265SDimitry Andric 291349cc55cSDimitry Andricdef Has3E3r1 : SubtargetFeature<"3e3r1", "Has3E3r1", "true", 292349cc55cSDimitry Andric "Support CSKY 3e3r1 instructions">; 293349cc55cSDimitry Andricdef iHas3E3r1 : Predicate<"Subtarget->has3E3r1()">, 294349cc55cSDimitry Andric AssemblerPredicate<(all_of Has3E3r1), 295349cc55cSDimitry Andric "Support CSKY 3e3r1 instructions">; 296349cc55cSDimitry Andric 29781ad6265SDimitry Andricdef Has3r1E3r2 : SubtargetFeature<"3e3r2", "Has3r1E3r2", "true", 29881ad6265SDimitry Andric "Support CSKY 3e3r2 instructions", 29981ad6265SDimitry Andric [Has3E3r1, FeatureDoloop]>; 30081ad6265SDimitry Andricdef iHas3r1E3r2 : Predicate<"Subtarget->has3r1E3r2()">, 30181ad6265SDimitry Andric AssemblerPredicate<(all_of Has3r1E3r2), 30281ad6265SDimitry Andric "Support CSKY 3e3r2 instructions">; 30381ad6265SDimitry Andric 304349cc55cSDimitry Andricdef Has3r2E3r3 305349cc55cSDimitry Andric : SubtargetFeature<"3e3r3", "Has3r2E3r3", "true", 306349cc55cSDimitry Andric "Support CSKY 3e3r3 instructions", [FeatureDoloop]>; 307349cc55cSDimitry Andricdef iHas3r2E3r3 : Predicate<"Subtarget->has3r2E3r3()">, 308349cc55cSDimitry Andric AssemblerPredicate<(all_of Has3r2E3r3), 309349cc55cSDimitry Andric "Support CSKY 3e3r3 instructions">; 310349cc55cSDimitry Andric 311349cc55cSDimitry Andricdef Has3E7 : SubtargetFeature<"3e7", "Has3E7", "true", 312349cc55cSDimitry Andric "Support CSKY 3e7 instructions", [Has2E3]>; 313349cc55cSDimitry Andricdef iHas3E7 : Predicate<"Subtarget->has3E7()">, 314349cc55cSDimitry Andric AssemblerPredicate<(all_of Has3E7), 315349cc55cSDimitry Andric "Support CSKY 3e7 instructions">; 316349cc55cSDimitry Andric 317349cc55cSDimitry Andricdef HasMP1E2 : SubtargetFeature<"mp1e2", "HasMP1E2", "true", 318349cc55cSDimitry Andric "Support CSKY mp1e2 instructions", [Has3E7]>; 319349cc55cSDimitry Andricdef iHasMP1E2 : Predicate<"Subtarget->hasMP1E2()">, 320349cc55cSDimitry Andric AssemblerPredicate<(all_of HasMP1E2), 321349cc55cSDimitry Andric "Support CSKY mp1e2 instructions">; 322349cc55cSDimitry Andric 323349cc55cSDimitry Andricdef Has7E10 : SubtargetFeature<"7e10", "Has7E10", "true", 324349cc55cSDimitry Andric "Support CSKY 7e10 instructions", [Has3E7]>; 325349cc55cSDimitry Andricdef iHas7E10 : Predicate<"Subtarget->has7E10()">, 326349cc55cSDimitry Andric AssemblerPredicate<(all_of Has7E10), 327349cc55cSDimitry Andric "Support CSKY 7e10 instructions">; 328349cc55cSDimitry Andric 329349cc55cSDimitry Andricdef Has10E60 : SubtargetFeature<"10e60", "Has10E60", "true", 330349cc55cSDimitry Andric "Support CSKY 10e60 instructions", [Has7E10]>; 331349cc55cSDimitry Andricdef iHas10E60 : Predicate<"Subtarget->has10E60()">, 332349cc55cSDimitry Andric AssemblerPredicate<(all_of Has10E60), 333349cc55cSDimitry Andric "Support CSKY 10e60 instructions">; 334349cc55cSDimitry Andric 335349cc55cSDimitry Andric//===----------------------------------------------------------------------===// 33681ad6265SDimitry Andric// CSKY Processor subtarget features. 33781ad6265SDimitry Andric//===----------------------------------------------------------------------===// 33881ad6265SDimitry Andric 33981ad6265SDimitry Andricdef ProcCK801 : SubtargetFeature<"ck801", "CSKYProcFamily", "CK801", 34081ad6265SDimitry Andric "CSKY ck801 processors", []>; 34181ad6265SDimitry Andricdef isCK801 : Predicate<"Subtarget->isCK801()">, 34281ad6265SDimitry Andric AssemblerPredicate<(all_of ProcCK801)>; 34381ad6265SDimitry Andricdef ProcCK802 : SubtargetFeature<"ck802", "CSKYProcFamily", "CK802", 34481ad6265SDimitry Andric "CSKY ck802 processors", []>; 34581ad6265SDimitry Andricdef ProcCK803 : SubtargetFeature<"ck803", "CSKYProcFamily", "CK803", 34681ad6265SDimitry Andric "CSKY ck803 processors", []>; 34781ad6265SDimitry Andricdef ProcCK803S : SubtargetFeature<"ck803s", "CSKYProcFamily", "CK803S", 34881ad6265SDimitry Andric "CSKY ck803s processors", []>; 34981ad6265SDimitry Andricdef ProcCK804 : SubtargetFeature<"ck804", "CSKYProcFamily", "CK804", 35081ad6265SDimitry Andric "CSKY ck804 processors", []>; 35181ad6265SDimitry Andricdef ProcCK805 : SubtargetFeature<"ck805", "CSKYProcFamily", "CK805", 35281ad6265SDimitry Andric "CSKY ck805 processors", []>; 35381ad6265SDimitry Andricdef ProcCK807 : SubtargetFeature<"ck807", "CSKYProcFamily", "CK807", 35481ad6265SDimitry Andric "CSKY ck807 processors", []>; 35581ad6265SDimitry Andricdef ProcCK810 : SubtargetFeature<"ck810", "CSKYProcFamily", "CK810", 35681ad6265SDimitry Andric "CSKY ck810 processors", []>; 35781ad6265SDimitry Andricdef ProcCK810V : SubtargetFeature<"ck810v", "CSKYProcFamily", "CK810V", 35881ad6265SDimitry Andric "CSKY ck810v processors", []>; 35981ad6265SDimitry Andricdef ProcCK860 : SubtargetFeature<"ck860", "CSKYProcFamily", "CK860", 36081ad6265SDimitry Andric "CSKY ck860 processors", []>; 36181ad6265SDimitry Andricdef ProcCK860V : SubtargetFeature<"ck860v", "CSKYProcFamily", "CK860V", 36281ad6265SDimitry Andric "CSKY ck860v processors", []>; 36381ad6265SDimitry Andric 36481ad6265SDimitry Andric//===----------------------------------------------------------------------===// 365e8d8bef9SDimitry Andric// Registers, calling conventions, instruction descriptions. 366e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===// 367e8d8bef9SDimitry Andric 368e8d8bef9SDimitry Andricinclude "CSKYRegisterInfo.td" 369349cc55cSDimitry Andricinclude "CSKYCallingConv.td" 370e8d8bef9SDimitry Andricinclude "CSKYInstrInfo.td" 371e8d8bef9SDimitry Andric 372e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===// 373e8d8bef9SDimitry Andric// CSKY processors supported. 374e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===// 375e8d8bef9SDimitry Andric 376bdd1243dSDimitry Andric// btsti16 is one of most basic instructions should be enable 377bdd1243dSDimitry Andric// even in generic processor to avoid failure codegen. 378bdd1243dSDimitry Andricdef : ProcessorModel<"generic", NoSchedModel, [FeatureBTST16]>; 379e8d8bef9SDimitry Andric 38081ad6265SDimitry Andric// CK801 series 38181ad6265SDimitry Andricclass CK801<string n, SchedMachineModel m, list<SubtargetFeature> f, 38281ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 38381ad6265SDimitry Andric : ProcessorModel<n, m, !listconcat(f, [HasE1, FeatureTrust, FeatureBTST16, ProcCK801]), !listconcat(tunef, [])>; 38481ad6265SDimitry Andric 38581ad6265SDimitry Andricdef : CK801<"ck801", NoSchedModel, []>; 38681ad6265SDimitry Andricdef : CK801<"ck801t", NoSchedModel, []>; 38781ad6265SDimitry Andricdef : CK801<"e801", NoSchedModel, []>; 38881ad6265SDimitry Andric 38981ad6265SDimitry Andric// CK802 series 39081ad6265SDimitry Andricclass CK802<string n, SchedMachineModel m, list<SubtargetFeature> f, 39181ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 39281ad6265SDimitry Andric : ProcessorModel<n, m, !listconcat(f, [HasE2, FeatureTrust, FeatureBTST16, FeatureNVIC, ProcCK802]), !listconcat(tunef, [])>; 39381ad6265SDimitry Andric 39481ad6265SDimitry Andricdef : CK802<"ck802", NoSchedModel, []>; 39581ad6265SDimitry Andricdef : CK802<"ck802t", NoSchedModel, []>; 39681ad6265SDimitry Andricdef : CK802<"ck802j", NoSchedModel, [FeatureJAVA]>; 39781ad6265SDimitry Andricdef : CK802<"e802", NoSchedModel, []>; 39881ad6265SDimitry Andricdef : CK802<"e802t", NoSchedModel, []>; 39981ad6265SDimitry Andricdef : CK802<"s802", NoSchedModel, []>; 40081ad6265SDimitry Andricdef : CK802<"s802t", NoSchedModel, []>; 40181ad6265SDimitry Andric 40281ad6265SDimitry Andric// CK803 series 40381ad6265SDimitry Andricclass CK803<string n, SchedMachineModel m, list<SubtargetFeature> f, 40481ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 40581ad6265SDimitry Andric : ProcessorModel<n, m, !listconcat(f, [Has2E3, HasMP, FeatureTrust, FeatureBTST16, FeatureNVIC, FeatureHWDiv, ProcCK803]), !listconcat(tunef, [])>; 40681ad6265SDimitry Andric 40781ad6265SDimitry Andricdef : CK803<"ck803", NoSchedModel, []>; 40881ad6265SDimitry Andricdef : CK803<"ck803h", NoSchedModel, []>; 40981ad6265SDimitry Andricdef : CK803<"ck803t", NoSchedModel, []>; 41081ad6265SDimitry Andricdef : CK803<"ck803ht", NoSchedModel, []>; 41181ad6265SDimitry Andricdef : CK803<"ck803f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 41281ad6265SDimitry Andricdef : CK803<"ck803fh", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 41381ad6265SDimitry Andricdef : CK803<"ck803e", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>; 41481ad6265SDimitry Andricdef : CK803<"ck803eh", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>; 41581ad6265SDimitry Andricdef : CK803<"ck803et", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>; 41681ad6265SDimitry Andricdef : CK803<"ck803eht", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>; 41781ad6265SDimitry Andricdef : CK803<"ck803ef", NoSchedModel, 41881ad6265SDimitry Andric [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 41981ad6265SDimitry Andricdef : CK803<"ck803efh", NoSchedModel, 42081ad6265SDimitry Andric [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 42181ad6265SDimitry Andricdef : CK803<"ck803ft", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 42281ad6265SDimitry Andricdef : CK803<"ck803eft", NoSchedModel, 42381ad6265SDimitry Andric [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 42481ad6265SDimitry Andricdef : CK803<"ck803efht", NoSchedModel, 42581ad6265SDimitry Andric [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 42681ad6265SDimitry Andricdef : CK803<"ck803r1", NoSchedModel, [Has3E3r1, Has3r2E3r3, FeatureDSPV2]>; 42781ad6265SDimitry Andricdef : CK803<"ck803hr1", NoSchedModel, [Has3E3r1, Has3r2E3r3, FeatureDSPV2]>; 42881ad6265SDimitry Andricdef : CK803<"ck803tr1", NoSchedModel, [Has3E3r1, Has3r2E3r3, FeatureDSPV2]>; 42981ad6265SDimitry Andricdef : CK803<"ck803htr1", NoSchedModel, [Has3E3r1, Has3r2E3r3, FeatureDSPV2]>; 43081ad6265SDimitry Andricdef : CK803<"ck803fr1", NoSchedModel, 43181ad6265SDimitry Andric [Has3E3r1, Has3r2E3r3, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureDSPV2]>; 43281ad6265SDimitry Andricdef : CK803<"ck803fhr1", NoSchedModel, 43381ad6265SDimitry Andric [Has3E3r1, Has3r2E3r3, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureDSPV2]>; 43481ad6265SDimitry Andricdef : CK803<"ck803er1", NoSchedModel, 43581ad6265SDimitry Andric [Has3E3r1, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 43681ad6265SDimitry Andricdef : CK803<"ck803etr1", NoSchedModel, 43781ad6265SDimitry Andric [Has3E3r1, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 43881ad6265SDimitry Andricdef : CK803<"ck803ehr1", NoSchedModel, 43981ad6265SDimitry Andric [Has3E3r1, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 44081ad6265SDimitry Andricdef : CK803<"ck803ehtr1", NoSchedModel, 44181ad6265SDimitry Andric [Has3E3r1, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 44281ad6265SDimitry Andricdef : CK803<"ck803efr1", NoSchedModel, 44381ad6265SDimitry Andric [Has3E3r1, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 44481ad6265SDimitry Andricdef : CK803<"ck803efhr1", NoSchedModel, 44581ad6265SDimitry Andric [Has3E3r1, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 44681ad6265SDimitry Andricdef : CK803<"ck803ftr1", NoSchedModel, [Has3E3r1, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureDSPV2]>; 44781ad6265SDimitry Andricdef : CK803<"ck803eftr1", NoSchedModel, 44881ad6265SDimitry Andric [Has3E3r1, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 44981ad6265SDimitry Andricdef : CK803<"ck803efhtr1", NoSchedModel, 45081ad6265SDimitry Andric [Has3E3r1, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 45181ad6265SDimitry Andricdef : CK803<"ck803r2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>; 45281ad6265SDimitry Andricdef : CK803<"ck803hr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>; 45381ad6265SDimitry Andricdef : CK803<"ck803tr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>; 45481ad6265SDimitry Andricdef : CK803<"ck803htr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>; 45581ad6265SDimitry Andricdef : CK803<"ck803fr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 45681ad6265SDimitry Andricdef : CK803<"ck803fhr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 45781ad6265SDimitry Andricdef : CK803<"ck803er2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 45881ad6265SDimitry Andricdef : CK803<"ck803etr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 45981ad6265SDimitry Andricdef : CK803<"ck803ehr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 46081ad6265SDimitry Andricdef : CK803<"ck803ehtr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 46181ad6265SDimitry Andricdef : CK803<"ck803efr2", NoSchedModel, 46281ad6265SDimitry Andric [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 46381ad6265SDimitry Andricdef : CK803<"ck803efhr2", NoSchedModel, 46481ad6265SDimitry Andric [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 46581ad6265SDimitry Andricdef : CK803<"ck803ftr2", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 46681ad6265SDimitry Andricdef : CK803<"ck803eftr2", NoSchedModel, 46781ad6265SDimitry Andric [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 46881ad6265SDimitry Andricdef : CK803<"ck803efhtr2", NoSchedModel, 46981ad6265SDimitry Andric [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 47081ad6265SDimitry Andricdef : CK803<"ck803r3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>; 47181ad6265SDimitry Andricdef : CK803<"ck803hr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>; 47281ad6265SDimitry Andricdef : CK803<"ck803tr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>; 47381ad6265SDimitry Andricdef : CK803<"ck803htr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2]>; 47481ad6265SDimitry Andricdef : CK803<"ck803fr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 47581ad6265SDimitry Andricdef : CK803<"ck803fhr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 47681ad6265SDimitry Andricdef : CK803<"ck803er3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 47781ad6265SDimitry Andricdef : CK803<"ck803etr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 47881ad6265SDimitry Andricdef : CK803<"ck803ehr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 47981ad6265SDimitry Andricdef : CK803<"ck803ehtr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureHighreg]>; 48081ad6265SDimitry Andricdef : CK803<"ck803efr3", NoSchedModel, 48181ad6265SDimitry Andric [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 48281ad6265SDimitry Andricdef : CK803<"ck803efhr3", NoSchedModel, 48381ad6265SDimitry Andric [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 48481ad6265SDimitry Andricdef : CK803<"ck803ftr3", NoSchedModel, [Has3r1E3r2, Has3r2E3r3, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 48581ad6265SDimitry Andricdef : CK803<"ck803eftr3", NoSchedModel, 48681ad6265SDimitry Andric [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 48781ad6265SDimitry Andricdef : CK803<"ck803efhtr3", NoSchedModel, 48881ad6265SDimitry Andric [Has3r1E3r2, Has3r2E3r3, FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 48981ad6265SDimitry Andricdef : CK803<"s803", NoSchedModel, [Has3r1E3r2, Has3r2E3r3]>; 49081ad6265SDimitry Andricdef : CK803<"s803t", NoSchedModel, [Has3r1E3r2, Has3r2E3r3]>; 49181ad6265SDimitry Andricdef : CK803<"e803", NoSchedModel, [Has3r1E3r2, Has3r2E3r3]>; 49281ad6265SDimitry Andricdef : CK803<"e803t", NoSchedModel, [Has3r1E3r2, Has3r2E3r3]>; 49381ad6265SDimitry Andric 49481ad6265SDimitry Andric// CK803S series 49581ad6265SDimitry Andricclass CK803S<string n, SchedMachineModel m, list<SubtargetFeature> f, 49681ad6265SDimitry Andriclist<SubtargetFeature> tunef = []> : CK803<n, m, !listconcat(f, [Has3E3r1, ProcCK803S]), tunef>; 49781ad6265SDimitry Andric 49881ad6265SDimitry Andricdef : CK803S<"ck803s", NoSchedModel, []>; 49981ad6265SDimitry Andricdef : CK803S<"ck803sn", NoSchedModel, [FeatureDSP_Silan]>; 50081ad6265SDimitry Andricdef : CK803S<"ck803st", NoSchedModel, []>; 50181ad6265SDimitry Andricdef : CK803S<"ck803snt", NoSchedModel, [FeatureDSP_Silan]>; 50281ad6265SDimitry Andricdef : CK803S<"ck803sf", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 50381ad6265SDimitry Andricdef : CK803S<"ck803sfn", NoSchedModel, [FeatureFPUV2_SF, FeatureDSP_Silan, HasFLOATE1, HasFLOAT1E3]>; 50481ad6265SDimitry Andricdef : CK803S<"ck803se", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>; 50581ad6265SDimitry Andricdef : CK803S<"ck803sen", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureDSP_Silan]>; 50681ad6265SDimitry Andricdef : CK803S<"ck803sef", NoSchedModel, 50781ad6265SDimitry Andric [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 50881ad6265SDimitry Andricdef : CK803S<"ck803sefn", NoSchedModel, 50981ad6265SDimitry Andric [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, FeatureDSP_Silan, 51081ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E3]>; 51181ad6265SDimitry Andricdef : CK803S<"ck803seft", NoSchedModel, 51281ad6265SDimitry Andric [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 51381ad6265SDimitry Andricdef : CK803S<"ck803sefnt", NoSchedModel, 51481ad6265SDimitry Andric [FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, FeatureDSP_Silan, 51581ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E3]>; 51681ad6265SDimitry Andric 51781ad6265SDimitry Andric// CK804 series 51881ad6265SDimitry Andricclass CK804<string n, SchedMachineModel m, list<SubtargetFeature> f, 51981ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 52081ad6265SDimitry Andric : CK803<n, m, !listconcat(f, [Has3r1E3r2, Has3r2E3r3, ProcCK804]), !listconcat(tunef, [])>; 52181ad6265SDimitry Andric 52281ad6265SDimitry Andricdef : CK804<"ck804", NoSchedModel, []>; 52381ad6265SDimitry Andricdef : CK804<"ck804h", NoSchedModel, []>; 52481ad6265SDimitry Andricdef : CK804<"ck804t", NoSchedModel, []>; 52581ad6265SDimitry Andricdef : CK804<"ck804ht", NoSchedModel, []>; 52681ad6265SDimitry Andricdef : CK804<"ck804f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 52781ad6265SDimitry Andricdef : CK804<"ck804fh", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 52881ad6265SDimitry Andricdef : CK804<"ck804e", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>; 52981ad6265SDimitry Andricdef : CK804<"ck804et", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>; 53081ad6265SDimitry Andricdef : CK804<"ck804eh", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>; 53181ad6265SDimitry Andricdef : CK804<"ck804eht", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>; 53281ad6265SDimitry Andricdef : CK804<"ck804ef", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 53381ad6265SDimitry Andricdef : CK804<"ck804efh", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 53481ad6265SDimitry Andricdef : CK804<"ck804ft", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 53581ad6265SDimitry Andricdef : CK804<"ck804eft", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 53681ad6265SDimitry Andricdef : CK804<"ck804efht", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 53781ad6265SDimitry Andricdef : CK804<"e804d", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>; 53881ad6265SDimitry Andricdef : CK804<"e804dt", NoSchedModel, [FeatureDSPV2, FeatureHighreg]>; 53981ad6265SDimitry Andricdef : CK804<"e804f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 54081ad6265SDimitry Andricdef : CK804<"e804ft", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 54181ad6265SDimitry Andricdef : CK804<"e804df", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 54281ad6265SDimitry Andricdef : CK804<"e804dft", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3, FeatureHighreg]>; 54381ad6265SDimitry Andric 54481ad6265SDimitry Andric// CK805 series 54581ad6265SDimitry Andricclass CK805<string n, SchedMachineModel m, list<SubtargetFeature> f, 54681ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 54781ad6265SDimitry Andric : CK803<n, m, !listconcat(f, [FeatureHighreg, FeatureVDSPV2, HasVDSP2E3, Has3r1E3r2, Has3r2E3r3, ProcCK805]), 54881ad6265SDimitry Andric !listconcat(tunef, [])>; 54981ad6265SDimitry Andric 55081ad6265SDimitry Andricdef : CK805<"ck805", NoSchedModel, []>; 55181ad6265SDimitry Andricdef : CK805<"i805", NoSchedModel, []>; 55281ad6265SDimitry Andricdef : CK805<"ck805t", NoSchedModel, []>; 55381ad6265SDimitry Andricdef : CK805<"i805f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 55481ad6265SDimitry Andricdef : CK805<"ck805f", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 55581ad6265SDimitry Andricdef : CK805<"ck805e", NoSchedModel, [FeatureDSPV2]>; 55681ad6265SDimitry Andricdef : CK805<"ck805ef", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 55781ad6265SDimitry Andricdef : CK805<"ck805et", NoSchedModel, [FeatureDSPV2]>; 55881ad6265SDimitry Andricdef : CK805<"ck805ft", NoSchedModel, [FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 55981ad6265SDimitry Andricdef : CK805<"ck805eft", NoSchedModel, [FeatureDSPV2, FeatureFPUV2_SF, HasFLOATE1, HasFLOAT1E3]>; 56081ad6265SDimitry Andric 56181ad6265SDimitry Andric// CK807 series 56281ad6265SDimitry Andricclass CK807<string n, SchedMachineModel m, list<SubtargetFeature> f, 56381ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 56481ad6265SDimitry Andric : ProcessorModel<n, m, !listconcat(f, 56581ad6265SDimitry Andric [ Has3E7, HasMP, HasMP1E2, FeatureTrust, FeatureHWDiv, FeatureDSP, HasDSP1E2, HasDSPE60, 56681ad6265SDimitry Andric FeatureHighreg, FeatureHardTP, FeatureNVIC, FeatureCache, ProcCK807]), !listconcat(tunef, [])>; 56781ad6265SDimitry Andric 56881ad6265SDimitry Andricdef : CK807<"ck807", NoSchedModel, []>; 56981ad6265SDimitry Andricdef : CK807<"c807", NoSchedModel, []>; 57081ad6265SDimitry Andricdef : CK807<"r807", NoSchedModel, []>; 57181ad6265SDimitry Andricdef : CK807<"ck807e", NoSchedModel, [FeatureDSP, HasDSP1E2, HasDSPE60]>; 57281ad6265SDimitry Andricdef : CK807<"ck807f", NoSchedModel, 57381ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 57481ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2, HasFLOAT1E3, HasFLOAT3E4]>; 57581ad6265SDimitry Andricdef : CK807<"c807f", NoSchedModel, 57681ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 57781ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2, HasFLOAT1E3, HasFLOAT3E4]>; 57881ad6265SDimitry Andricdef : CK807<"r807f", NoSchedModel, 57981ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 58081ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2, HasFLOAT1E3, HasFLOAT3E4]>; 58181ad6265SDimitry Andricdef : CK807<"ck807ef", NoSchedModel, [ 58281ad6265SDimitry Andric FeatureDSP, HasDSP1E2, HasDSPE60, FeatureFPUV2_SF, FeatureFPUV2_DF, 58381ad6265SDimitry Andric FeatureFdivdu, HasFLOATE1, HasFLOAT1E2, HasFLOAT1E3, HasFLOAT3E4]>; 58481ad6265SDimitry Andric 58581ad6265SDimitry Andric// CK810 series 58681ad6265SDimitry Andricclass CK810<string n, SchedMachineModel m, list<SubtargetFeature> f, 58781ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 58881ad6265SDimitry Andric : ProcessorModel<n, m, !listconcat(f, 58981ad6265SDimitry Andric [ Has7E10, HasMP, HasMP1E2, FeatureTrust, FeatureHWDiv, FeatureDSP, HasDSP1E2, HasDSPE60, 59081ad6265SDimitry Andric FeatureHighreg, FeatureHardTP, FeatureNVIC, FeatureCache, ProcCK810]), !listconcat(tunef, [])>; 59181ad6265SDimitry Andric 59281ad6265SDimitry Andricdef : CK810<"ck810", NoSchedModel, []>; 59381ad6265SDimitry Andricdef : CK810<"ck810e", NoSchedModel, []>; 59481ad6265SDimitry Andricdef : CK810<"ck810t", NoSchedModel, []>; 59581ad6265SDimitry Andricdef : CK810<"ck810et", NoSchedModel, []>; 59681ad6265SDimitry Andricdef : CK810<"c810", NoSchedModel, 59781ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 59881ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2]>; 59981ad6265SDimitry Andricdef : CK810<"ck810f", NoSchedModel, 60081ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 60181ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2]>; 60281ad6265SDimitry Andricdef : CK810<"ck810ef", NoSchedModel, 60381ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 60481ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2]>; 60581ad6265SDimitry Andricdef : CK810<"ck810ft", NoSchedModel, 60681ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 60781ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2]>; 60881ad6265SDimitry Andricdef : CK810<"ck810eft", NoSchedModel, 60981ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 61081ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2]>; 61181ad6265SDimitry Andricdef : CK810<"c810t", NoSchedModel, 61281ad6265SDimitry Andric [FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 61381ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2]>; 61481ad6265SDimitry Andric 61581ad6265SDimitry Andricclass CK810V<string n, SchedMachineModel m, list<SubtargetFeature> f, 61681ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 61781ad6265SDimitry Andric : CK810<n, m, !listconcat(f, [FeatureVDSPV1_128, ProcCK810V]), !listconcat(tunef, [])>; 61881ad6265SDimitry Andric 61981ad6265SDimitry Andricdef : CK810V<"ck810v", NoSchedModel, []>; 62081ad6265SDimitry Andricdef : CK810V<"ck810ev", NoSchedModel, []>; 62181ad6265SDimitry Andricdef : CK810V<"ck810tv", NoSchedModel, []>; 62281ad6265SDimitry Andricdef : CK810V<"ck810etv", NoSchedModel, []>; 62381ad6265SDimitry Andricdef : CK810V<"ck810fv", NoSchedModel, [ 62481ad6265SDimitry Andric FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 62581ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2 62681ad6265SDimitry Andric]>; 62781ad6265SDimitry Andricdef : CK810V<"ck810efv", NoSchedModel, [ 62881ad6265SDimitry Andric FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 62981ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2 63081ad6265SDimitry Andric]>; 63181ad6265SDimitry Andricdef : CK810V<"c810v", NoSchedModel, [ 63281ad6265SDimitry Andric FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 63381ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2 63481ad6265SDimitry Andric]>; 63581ad6265SDimitry Andricdef : CK810V<"ck810ftv", NoSchedModel, [ 63681ad6265SDimitry Andric FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 63781ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2 63881ad6265SDimitry Andric]>; 63981ad6265SDimitry Andricdef : CK810V<"ck810eftv", NoSchedModel, [ 64081ad6265SDimitry Andric FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 64181ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2 64281ad6265SDimitry Andric]>; 64381ad6265SDimitry Andricdef : CK810V<"c810tv", NoSchedModel, [ 64481ad6265SDimitry Andric FeatureFPUV2_SF, FeatureFPUV2_DF, FeatureFdivdu, 64581ad6265SDimitry Andric HasFLOATE1, HasFLOAT1E2 64681ad6265SDimitry Andric]>; 64781ad6265SDimitry Andric 64881ad6265SDimitry Andric// CK860 series 64981ad6265SDimitry Andricclass CK860<string n, SchedMachineModel m, list<SubtargetFeature> f, 65081ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 65181ad6265SDimitry Andric : ProcessorModel<n, m, !listconcat(f, 65281ad6265SDimitry Andric [ Has10E60, HasMP, HasMP1E2, Has3r1E3r2, Has3r2E3r3, FeatureTrust, FeatureBTST16, FeatureHWDiv, HasDSPE60, 65381ad6265SDimitry Andric FeatureHighreg, FeatureHardTP, FeatureNVIC, FeatureCache, ProcCK860]), !listconcat(tunef, [])>; 65481ad6265SDimitry Andric 65581ad6265SDimitry Andricclass CK860V<string n, SchedMachineModel m, list<SubtargetFeature> f, 65681ad6265SDimitry Andric list<SubtargetFeature> tunef = []> 65781ad6265SDimitry Andric : CK860<n, m, !listconcat(f, [FeatureVDSPV2, HasVDSP2E60F, ProcCK860V]), !listconcat(tunef, [])>; 65881ad6265SDimitry Andric 65981ad6265SDimitry Andricdef : CK860<"ck860", NoSchedModel, []>; 66081ad6265SDimitry Andricdef : CK860<"ck860f", NoSchedModel, 66181ad6265SDimitry Andric [FeatureFPUV3_HI, FeatureFPUV3_HF, FeatureFPUV3_SF, FeatureFPUV3_DF, HasFLOAT7E60]>; 66281ad6265SDimitry Andricdef : CK860<"c860", NoSchedModel, 66381ad6265SDimitry Andric [FeatureFPUV3_HI, FeatureFPUV3_HF, FeatureFPUV3_SF, FeatureFPUV3_DF, HasFLOAT7E60]>; 66481ad6265SDimitry Andricdef : CK860V<"c860v", NoSchedModel, 66581ad6265SDimitry Andric [FeatureFPUV3_HI, FeatureFPUV3_HF, FeatureFPUV3_SF, FeatureFPUV3_DF, HasFLOAT7E60]>; 66681ad6265SDimitry Andricdef : CK860V<"ck860v", NoSchedModel, []>; 66781ad6265SDimitry Andricdef : CK860V<"ck860fv", NoSchedModel, 66881ad6265SDimitry Andric [FeatureFPUV3_HI, FeatureFPUV3_HF, FeatureFPUV3_SF, FeatureFPUV3_DF, HasFLOAT7E60]>; 66981ad6265SDimitry Andric 670e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===// 671e8d8bef9SDimitry Andric// Define the CSKY target. 672e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===// 673e8d8bef9SDimitry Andric 674e8d8bef9SDimitry Andricdef CSKYInstrInfo : InstrInfo; 675e8d8bef9SDimitry Andric 676fe6060f1SDimitry Andric 677fe6060f1SDimitry Andricdef CSKYAsmParser : AsmParser { 678fe6060f1SDimitry Andric let ShouldEmitMatchRegisterAltName = 1; 679fe6060f1SDimitry Andric let AllowDuplicateRegisterNames = 1; 680fe6060f1SDimitry Andric} 681fe6060f1SDimitry Andric 682fe6060f1SDimitry Andricdef CSKYAsmWriter : AsmWriter { 683fe6060f1SDimitry Andric int PassSubtarget = 1; 684fe6060f1SDimitry Andric} 685fe6060f1SDimitry Andric 686e8d8bef9SDimitry Andricdef CSKY : Target { 687e8d8bef9SDimitry Andric let InstructionSet = CSKYInstrInfo; 688fe6060f1SDimitry Andric let AssemblyParsers = [CSKYAsmParser]; 689fe6060f1SDimitry Andric let AssemblyWriters = [CSKYAsmWriter]; 690fe6060f1SDimitry Andric let AllowRegisterRenaming = 1; 691e8d8bef9SDimitry Andric} 692