File: CSKY.td

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (166 lines) | stat: -rw-r--r-- 7,169 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//===-- CSKY.td - Describe the CSKY Target Machine ---------*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

include "llvm/Target/Target.td"

//===----------------------------------------------------------------------===//
// CSKY subtarget features and instruction predicates.
//===----------------------------------------------------------------------===//
def ModeHardFloat :
  SubtargetFeature<"hard-float", "UseHardFloat",
                   "true", "Use hard floating point features">;
def ModeHardFloatABI :
  SubtargetFeature<"hard-float-abi", "UseHardFloatABI",
                   "true", "Use hard floating point ABI to pass args">;

def FeatureFPUV2_SF
    : SubtargetFeature<"fpuv2_sf", "HasFPUv2SingleFloat", "true",
                       "Enable FPUv2 single float instructions">;
def HasFPUv2_SF : Predicate<"Subtarget->hasFPUv2SingleFloat()">,
                  AssemblerPredicate<(all_of FeatureFPUV2_SF),
                  "Enable FPUv2 single float instructions">;

def FeatureFPUV2_DF
    : SubtargetFeature<"fpuv2_df", "HasFPUv2DoubleFloat", "true",
                       "Enable FPUv2 double float instructions">;
def HasFPUv2_DF : Predicate<"Subtarget->hasFPUv2DoubleFloat()">,
                  AssemblerPredicate<(all_of FeatureFPUV2_DF),
                  "Enable FPUv2 double float instructions">;

def FeatureFPUV3_SF
    : SubtargetFeature<"fpuv3_sf", "HasFPUv3SingleFloat", "true",
                       "Enable FPUv3 single float instructions">;
def HasFPUv3_SF : Predicate<"Subtarget->hasFPUv3SingleFloat()">,
                  AssemblerPredicate<(all_of FeatureFPUV3_SF),
                  "Enable FPUv3 single float instructions">;

def FeatureFPUV3_DF
    : SubtargetFeature<"fpuv3_df", "HasFPUv3DoubleFloat", "true",
                       "Enable FPUv3 double float instructions">;
def HasFPUv3_DF : Predicate<"Subtarget->hasFPUv3DoubleFloat()">,
                  AssemblerPredicate<(all_of FeatureFPUV3_DF),
                  "Enable FPUv3 double float instructions">;

def FeatureBTST16 : SubtargetFeature<"btst16", "HasBTST16", "true",
                                     "Use the 16-bit btsti instruction">;
def HasBTST16 : Predicate<"Subtarget->hasBTST16()">,
                   AssemblerPredicate<(all_of FeatureBTST16),
                   "Use the 16-bit btsti instruction">;

// Atomic Support
def FeatureExtendLrw : SubtargetFeature<"elrw", "HasExtendLrw", "true",
                                        "Use the extend LRW instruction">;
def HasExtendLrw : Predicate<"Subtarget->hasExtendLrw()">,
                   AssemblerPredicate<(all_of FeatureExtendLrw),
                   "Use the extend LRW instruction">;

def FeatureJAVA
    : SubtargetFeature<"java", "HasJAVA", "true", "Enable java instructions">;
def HasJAVA : Predicate<"Subtarget->hasJAVA()">,
              AssemblerPredicate<(all_of FeatureJAVA),
              "Enable java instructions">;

def FeatureDoloop : SubtargetFeature<"doloop", "HasDoloop", "true",
                                     "Enable doloop instructions">;
def HasDoloop : Predicate<"Subtarget->hasDoloop()">,
                AssemblerPredicate<(all_of FeatureDoloop),
                "Enable doloop instructions">;

def HasE1
    : SubtargetFeature<"e1", "HasE1", "true", "Support CSKY e1 instructions",
                       [FeatureExtendLrw]>;
def iHasE1 : Predicate<"Subtarget->hasE1()">,
             AssemblerPredicate<(all_of HasE1),
             "Support CSKY e1 instructions">;

def HasE2
    : SubtargetFeature<"e2", "HasE2", "true", "Support CSKY e2 instructions",
                       [HasE1]>;
def iHasE2 : Predicate<"Subtarget->hasE2()">,
             AssemblerPredicate<(all_of HasE2),
             "Support CSKY e2 instructions">;

def Has2E3 : SubtargetFeature<"2e3", "Has2E3", "true",
                              "Support CSKY 2e3 instructions", [HasE2]>;
def iHas2E3 : Predicate<"Subtarget->has2E3()">,
              AssemblerPredicate<(all_of Has2E3),
              "Support CSKY 2e3 instructions">;

def Has3E3r1 : SubtargetFeature<"3e3r1", "Has3E3r1", "true",
                                "Support CSKY 3e3r1 instructions">;
def iHas3E3r1 : Predicate<"Subtarget->has3E3r1()">,
                AssemblerPredicate<(all_of Has3E3r1),
                "Support CSKY 3e3r1 instructions">;

def Has3r2E3r3
    : SubtargetFeature<"3e3r3", "Has3r2E3r3", "true",
                       "Support CSKY 3e3r3 instructions", [FeatureDoloop]>;
def iHas3r2E3r3 : Predicate<"Subtarget->has3r2E3r3()">,
                  AssemblerPredicate<(all_of Has3r2E3r3),
                  "Support CSKY 3e3r3 instructions">;

def Has3E7 : SubtargetFeature<"3e7", "Has3E7", "true",
                              "Support CSKY 3e7 instructions", [Has2E3]>;
def iHas3E7 : Predicate<"Subtarget->has3E7()">,
              AssemblerPredicate<(all_of Has3E7),
              "Support CSKY 3e7 instructions">;

def HasMP1E2 : SubtargetFeature<"mp1e2", "HasMP1E2", "true",
                                "Support CSKY mp1e2 instructions", [Has3E7]>;
def iHasMP1E2 : Predicate<"Subtarget->hasMP1E2()">,
                AssemblerPredicate<(all_of HasMP1E2),
                "Support CSKY mp1e2 instructions">;

def Has7E10 : SubtargetFeature<"7e10", "Has7E10", "true",
                               "Support CSKY 7e10 instructions", [Has3E7]>;
def iHas7E10 : Predicate<"Subtarget->has7E10()">,
               AssemblerPredicate<(all_of Has7E10),
               "Support CSKY 7e10 instructions">;

def Has10E60 : SubtargetFeature<"10e60", "Has10E60", "true",
                               "Support CSKY 10e60 instructions", [Has7E10]>;
def iHas10E60 : Predicate<"Subtarget->has10E60()">,
               AssemblerPredicate<(all_of Has10E60),
               "Support CSKY 10e60 instructions">;

//===----------------------------------------------------------------------===//
// Registers, calling conventions, instruction descriptions.
//===----------------------------------------------------------------------===//

include "CSKYRegisterInfo.td"
include "CSKYCallingConv.td"
include "CSKYInstrInfo.td"

//===----------------------------------------------------------------------===//
// CSKY processors supported.
//===----------------------------------------------------------------------===//

def : ProcessorModel<"generic", NoSchedModel, []>;

//===----------------------------------------------------------------------===//
// Define the CSKY target.
//===----------------------------------------------------------------------===//

def CSKYInstrInfo : InstrInfo;


def CSKYAsmParser : AsmParser {
  let ShouldEmitMatchRegisterAltName = 1;
  let AllowDuplicateRegisterNames = 1;
}

def CSKYAsmWriter : AsmWriter {
  int PassSubtarget = 1;
}

def CSKY : Target {
  let InstructionSet = CSKYInstrInfo;
  let AssemblyParsers = [CSKYAsmParser];
  let AssemblyWriters = [CSKYAsmWriter];
  let AllowRegisterRenaming = 1;
}