19 return llvm::CSKY::parseCPUArch(Name) != llvm::CSKY::ArchKind::INVALID;
23 llvm::CSKY::ArchKind archKind = llvm::CSKY::parseCPUArch(Name);
24 bool isValid = (archKind != llvm::CSKY::ArchKind::INVALID);
36 Builder.defineMacro(
"__csky__",
"2");
37 Builder.defineMacro(
"__CSKY__",
"2");
38 Builder.defineMacro(
"__ckcore__",
"2");
39 Builder.defineMacro(
"__CKCORE__",
"2");
41 Builder.defineMacro(
"__CSKYABI__",
ABI ==
"abiv2" ?
"2" :
"1");
42 Builder.defineMacro(
"__cskyabi__",
ABI ==
"abiv2" ?
"2" :
"1");
44 StringRef ArchName =
"ck810";
45 StringRef CPUName =
"ck810";
47 if (
Arch != llvm::CSKY::ArchKind::INVALID) {
48 ArchName = llvm::CSKY::getArchName(
Arch);
52 Builder.defineMacro(
"__" + ArchName.upper() +
"__");
53 Builder.defineMacro(
"__" + ArchName.lower() +
"__");
54 if (ArchName != CPUName) {
55 Builder.defineMacro(
"__" + CPUName.upper() +
"__");
56 Builder.defineMacro(
"__" + CPUName.lower() +
"__");
60 StringRef endian =
"__cskyLE__";
62 Builder.defineMacro(endian);
63 Builder.defineMacro(endian.upper());
64 Builder.defineMacro(endian.lower());
67 StringRef dspv2 =
"__CSKY_DSPV2__";
68 Builder.defineMacro(dspv2);
69 Builder.defineMacro(dspv2.lower());
73 StringRef vdspv2 =
"__CSKY_VDSPV2__";
74 Builder.defineMacro(vdspv2);
75 Builder.defineMacro(vdspv2.lower());
78 StringRef vdspv2_f =
"__CSKY_VDSPV2_F__";
79 Builder.defineMacro(vdspv2_f);
80 Builder.defineMacro(vdspv2_f.lower());
84 StringRef vdspv1_64 =
"__CSKY_VDSP64__";
85 StringRef vdspv1_128 =
"__CSKY_VDSP128__";
87 Builder.defineMacro(vdspv1_64);
88 Builder.defineMacro(vdspv1_64.lower());
89 Builder.defineMacro(vdspv1_128);
90 Builder.defineMacro(vdspv1_128.lower());
93 StringRef is3e3r1 =
"__CSKY_3E3R1__";
94 Builder.defineMacro(is3e3r1);
95 Builder.defineMacro(is3e3r1.lower());
100 return llvm::StringSwitch<bool>(Feature)
108 .Case(
"dspv2",
DSPV2)
116 for (
const auto &Feature : Features) {
117 if (Feature ==
"+hard-float")
119 if (Feature ==
"+hard-float-abi")
121 if (Feature ==
"+fpuv2_sf")
123 if (Feature ==
"+fpuv2_df")
125 if (Feature ==
"+fpuv3_sf")
127 if (Feature ==
"+fpuv3_df")
129 if (Feature ==
"+vdspv2")
131 if (Feature ==
"+dspv2")
133 if (Feature ==
"+vdspv1")
135 if (Feature ==
"+3e3r1")
245 {{
"t7",
"fp"},
"r23"},
246 {{
"t8",
"top"},
"r24"},
247 {{
"t9",
"bsp"},
"r25"},
250 {{
"gb",
"rgb",
"rdb"},
"r28"},
251 {{
"tb",
"rtb"},
"r29"},
312 bool HasNonWeakDef)
const {
Concrete class used by the front-end to report problems and issues.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
bool isValidCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name.
llvm::CSKY::ArchKind Arch
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
unsigned getMinGlobalAlign(uint64_t, bool HasNonWeakDef) const override
getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explic...
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
bool setCPU(const std::string &Name) override
Target the specified CPU.
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
Perform initialization based on the user configured set of features (e.g., +sse4).
ArrayRef< const char * > getGCCRegNames() const override
ArrayRef< GCCRegAlias > getGCCRegAliases() const override
static const char *const GCCRegNames[]
The JSON file list parser is used to communicate input to InstallAPI.