LLVM: lib/TargetParser/LoongArchTargetParser.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
16
17using namespace llvm;
19
21#define LOONGARCH_FEATURE(NAME, KIND) {NAME, KIND},
22#include "llvm/TargetParser/LoongArchTargetParser.def"
23};
24
26#define LOONGARCH_ARCH(NAME, KIND, FEATURES) \
27 {NAME, LoongArch::ArchKind::KIND, FEATURES},
28#include "llvm/TargetParser/LoongArchTargetParser.def"
29};
30
33 if (A.Name == Arch)
34 return true;
35 return false;
36}
37
40 return false;
43 F.Name.starts_with("+") ? F.Name.drop_front() : F.Name;
44 if (CanonicalName == Feature)
45 return true;
46 }
47 return false;
48}
49
51 std::vector &Features) {
53 if (A.Name == Arch) {
55 if ((A.Features & F.Kind) == F.Kind)
56 Features.push_back(F.Name);
57 return true;
58 }
59 }
60
61 if (Arch == "la64v1.0" || Arch == "la64v1.1") {
62 Features.push_back("+64bit");
63 Features.push_back("+d");
64 Features.push_back("+lsx");
65 Features.push_back("+ual");
66 if (Arch == "la64v1.1") {
67 Features.push_back("+frecipe");
68 Features.push_back("+lam-bh");
69 Features.push_back("+lamcas");
70 Features.push_back("+ld-seq-sa");
71 Features.push_back("+div32");
72 Features.push_back("+scq");
73 }
74 return true;
75 }
76
77 return false;
78}
79
81
86
88
89 return Is64Bit ? "loongarch64" : "";
90}
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
const FeatureInfo AllFeatures[]
Definition LoongArchTargetParser.cpp:20
const ArchInfo AllArchs[]
Definition LoongArchTargetParser.cpp:25
This file defines the SmallVector class.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
StringRef - Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
LLVM_ABI StringRef getDefaultArch(bool Is64Bit)
Definition LoongArchTargetParser.cpp:87
LLVM_ABI bool getArchFeatures(StringRef Arch, std::vector< StringRef > &Features)
Definition LoongArchTargetParser.cpp:50
LLVM_ABI bool isValidCPUName(StringRef TuneCPU)
Definition LoongArchTargetParser.cpp:80
LLVM_ABI bool isValidFeatureName(StringRef Feature)
Definition LoongArchTargetParser.cpp:38
LLVM_ABI bool isValidArchName(StringRef Arch)
Definition LoongArchTargetParser.cpp:31
LLVM_ABI void fillValidCPUList(SmallVectorImpl< StringRef > &Values)
Definition LoongArchTargetParser.cpp:82
This is an optimization pass for GlobalISel generic memory operations.