LLVM: lib/TargetParser/CSKYTargetParser.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
18
19using namespace llvm;
20
22 std::vector &Features) {
23
25 return false;
26
28 case FK_AUTO:
29 Features.push_back("+fpuv2_sf");
30 Features.push_back("+fpuv2_df");
31 Features.push_back("+fdivdu");
32 break;
33 case FK_FPV2:
34 Features.push_back("+fpuv2_sf");
35 Features.push_back("+fpuv2_df");
36 break;
37 case FK_FPV2_DIVD:
38 Features.push_back("+fpuv2_sf");
39 Features.push_back("+fpuv2_df");
40 Features.push_back("+fdivdu");
41 break;
42 case FK_FPV2_SF:
43 Features.push_back("+fpuv2_sf");
44 break;
45 case FK_FPV3:
46 Features.push_back("+fpuv3_hf");
47 Features.push_back("+fpuv3_hi");
48 Features.push_back("+fpuv3_sf");
49 Features.push_back("+fpuv3_df");
50 break;
51 case FK_FPV3_HF:
52 Features.push_back("+fpuv3_hf");
53 Features.push_back("+fpuv3_hi");
54 break;
55 case FK_FPV3_HSF:
56 Features.push_back("+fpuv3_hf");
57 Features.push_back("+fpuv3_hi");
58 Features.push_back("+fpuv3_sf");
59 break;
60 case FK_FPV3_SDF:
61 Features.push_back("+fpuv3_sf");
62 Features.push_back("+fpuv3_df");
63 break;
64 default:
66 return false;
67 }
68
69 return true;
70}
71
72
73
74
75
79
80
83 if (AK == CSKY::ArchKind::INVALID)
85
86 return Arch;
87}
88
89
90
91
94 if (A.getName() == Arch)
95 return A.ID;
96 }
97
98 return CSKY::ArchKind::INVALID;
99}
100
103 if (CPU == C.getName())
104 return C.ArchID;
105 }
106
107 return CSKY::ArchKind::INVALID;
108}
109
112 if (ArchExt == A.getName())
113 return A.ID;
114 }
116}
117
120 if (Arch.ArchID != CSKY::ArchKind::INVALID)
121 Values.push_back(Arch.getName());
122 }
123}
124
126 if (FPUKind >= FK_LAST)
128 return FPUNames[FPUKind].getName();
129}
130
132 if (FPUKind >= FK_LAST)
134 return FPUNames[FPUKind].FPUVer;
135}
136
139#define CSKY_CPU_NAME(NAME, ID, DEFAULT_EXT) \
140 .Case(NAME, ARCHNames[static_cast(ArchKind::ID)].archBaseExt | \
141 DEFAULT_EXT)
142#include "llvm/TargetParser/CSKYTargetParser.def"
144}
145
149 return AE.getName();
151}
152
154 if (Name.starts_with("no")) {
155 Name = Name.substr(2);
156 return true;
157 }
158 return false;
159}
160
164 if (AE.Feature && ArchExt == AE.getName())
165 return StringRef(Negated ? AE.NegFeature : AE.Feature);
166 }
167
169}
170
172 std::vector &Features) {
174 return false;
175
177 if ((Extensions & AE.ID) == AE.ID && AE.Feature)
178 Features.push_back(AE.Feature);
179 }
180
181 return true;
182}
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static bool stripNegationPrefix(StringRef &Name)
Definition CSKYTargetParser.cpp:153
static StringRef getName(Value *V)
static cl::opt< std::set< SPIRV::Extension::Extension >, false, SPIRVExtensionsParser > Extensions("spirv-ext", cl::desc("Specify list of enabled SPIR-V extensions"))
This file defines the SmallVector class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static Triple::ArchType parseArch(StringRef ArchName)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI StringRef getFPUName(unsigned FPUKind)
Definition CSKYTargetParser.cpp:125
LLVM_ABI StringRef getArchExtFeature(StringRef ArchExt)
Definition CSKYTargetParser.cpp:161
LLVM_ABI bool getExtensionFeatures(uint64_t Extensions, std::vector< StringRef > &Features)
Definition CSKYTargetParser.cpp:171
LLVM_ABI void fillValidCPUArchList(SmallVectorImpl< StringRef > &Values)
Definition CSKYTargetParser.cpp:118
const ArchNames< CSKY::ArchKind > ARCHNames[]
LLVM_ABI bool getFPUFeatures(CSKYFPUKind Kind, std::vector< StringRef > &Features)
Definition CSKYTargetParser.cpp:21
LLVM_ABI uint64_t parseArchExt(StringRef ArchExt)
Definition CSKYTargetParser.cpp:110
const CpuNames< CSKY::ArchKind > CPUNames[]
LLVM_ABI FPUVersion getFPUVersion(unsigned FPUKind)
Definition CSKYTargetParser.cpp:131
LLVM_ABI ArchKind parseCPUArch(StringRef CPU)
Definition CSKYTargetParser.cpp:101
LLVM_ABI ArchKind parseArch(StringRef Arch)
Definition CSKYTargetParser.cpp:92
LLVM_ABI StringRef getDefaultCPU(StringRef Arch)
Definition CSKYTargetParser.cpp:81
static const FPUName FPUNames[]
const CSKY::ExtName CSKYARCHExtNames[]
LLVM_ABI StringRef getArchExtName(uint64_t ArchExtKind)
Definition CSKYTargetParser.cpp:146
LLVM_ABI StringRef getArchName(ArchKind AK)
Definition CSKYTargetParser.cpp:76
LLVM_ABI uint64_t getDefaultExtensions(StringRef CPU)
Definition CSKYTargetParser.cpp:137
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.