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(
"__ELF__");
37 Builder.defineMacro(
"__csky__",
"2");
38 Builder.defineMacro(
"__CSKY__",
"2");
39 Builder.defineMacro(
"__ckcore__",
"2");
40 Builder.defineMacro(
"__CKCORE__",
"2");
42 Builder.defineMacro(
"__CSKYABI__",
ABI ==
"abiv2" ?
"2" :
"1");
43 Builder.defineMacro(
"__cskyabi__",
ABI ==
"abiv2" ?
"2" :
"1");
45 StringRef ArchName =
"ck810";
46 StringRef CPUName =
"ck810";
48 if (
Arch != llvm::CSKY::ArchKind::INVALID) {
49 ArchName = llvm::CSKY::getArchName(
Arch);
53 Builder.defineMacro(
"__" + ArchName.upper() +
"__");
54 Builder.defineMacro(
"__" + ArchName.lower() +
"__");
55 Builder.defineMacro(
"__" + CPUName.upper() +
"__");
56 Builder.defineMacro(
"__" + CPUName.lower() +
"__");
59 StringRef endian =
"__cskyLE__";
61 Builder.defineMacro(endian);
62 Builder.defineMacro(endian.upper());
63 Builder.defineMacro(endian.lower());
66 StringRef dspv2 =
"__CSKY_DSPV2__";
67 Builder.defineMacro(dspv2);
68 Builder.defineMacro(dspv2.lower());
72 StringRef vdspv2 =
"__CSKY_VDSPV2__";
73 Builder.defineMacro(vdspv2);
74 Builder.defineMacro(vdspv2.lower());
77 StringRef vdspv2_f =
"__CSKY_VDSPV2_F__";
78 Builder.defineMacro(vdspv2_f);
79 Builder.defineMacro(vdspv2_f.lower());
83 StringRef vdspv1_64 =
"__CSKY_VDSP64__";
84 StringRef vdspv1_128 =
"__CSKY_VDSP128__";
86 Builder.defineMacro(vdspv1_64);
87 Builder.defineMacro(vdspv1_64.lower());
88 Builder.defineMacro(vdspv1_128);
89 Builder.defineMacro(vdspv1_128.lower());
92 StringRef is3e3r1 =
"__CSKY_3E3R1__";
93 Builder.defineMacro(is3e3r1);
94 Builder.defineMacro(is3e3r1.lower());
99 return llvm::StringSwitch<bool>(Feature)
107 .Case(
"dspv2",
DSPV2)
115 for (
const auto &Feature : Features) {
116 if (Feature ==
"+hard-float")
118 if (Feature ==
"+hard-float-abi")
120 if (Feature ==
"+fpuv2_sf")
122 if (Feature ==
"+fpuv2_df")
124 if (Feature ==
"+fpuv3_sf")
126 if (Feature ==
"+fpuv3_df")
128 if (Feature ==
"+vdspv2")
130 if (Feature ==
"+dspv2")
132 if (Feature ==
"+vdspv1")
134 if (Feature ==
"+3e3r1")
244 {{
"t7",
"fp"},
"r23"},
245 {{
"t8",
"top"},
"r24"},
246 {{
"t9",
"bsp"},
"r25"},
249 {{
"gb",
"rgb",
"rdb"},
"r28"},
250 {{
"tb",
"rtb"},
"r29"},
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
brief 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) 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[]