18 #include "llvm/ADT/StringSwitch.h" 20 using namespace clang;
28 if (CPU ==
"hexagonv5") {
31 if (Opts.HexagonQdsp6Compat) {
35 }
else if (CPU ==
"hexagonv55") {
40 }
else if (CPU ==
"hexagonv60") {
45 }
else if (CPU ==
"hexagonv62") {
48 }
else if (CPU ==
"hexagonv65") {
51 }
else if (CPU ==
"hexagonv66") {
73 const std::vector<std::string> &FeaturesVec)
const {
74 Features[
"long-calls"] =
false;
81 for (
auto &F : Features) {
82 if (F ==
"+hvx-length64b")
83 HasHVX = HasHVX64B =
true;
84 else if (F ==
"+hvx-length128b")
85 HasHVX = HasHVX128B =
true;
86 else if (F.find(
"+hvxv") != std::string::npos) {
88 HVXVersion = F.substr(std::string(
"+hvxv").
length());
89 }
else if (F ==
"-hvx")
90 HasHVX = HasHVX64B = HasHVX128B =
false;
91 else if (F ==
"+long-calls")
93 else if (F ==
"-long-calls")
99 const char *
const HexagonTargetInfo::GCCRegNames[] = {
100 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
"r8",
101 "r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
"r16",
"r17",
102 "r18",
"r19",
"r20",
"r21",
"r22",
"r23",
"r24",
"r25",
"r26",
103 "r27",
"r28",
"r29",
"r30",
"r31",
"p0",
"p1",
"p2",
"p3",
104 "sa0",
"lc0",
"sa1",
"lc1",
"m0",
"m1",
"usr",
"ugp" 108 return llvm::makeArrayRef(GCCRegNames);
118 return llvm::makeArrayRef(GCCRegAliases);
122 #define BUILTIN(ID, TYPE, ATTRS) \ 123 {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr}, 124 #define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \ 125 {#ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES, nullptr}, 126 #include "clang/Basic/BuiltinsHexagon.def" 130 std::string VS =
"hvxv" + HVXVersion;
134 return llvm::StringSwitch<bool>(Feature)
135 .Case(
"hexagon",
true)
137 .Case(
"hvx-length64b", HasHVX64B)
138 .Case(
"hvx-length128b", HasHVX128B)
139 .Case(
"long-calls", UseLongCalls)
149 {{
"hexagonv5"}, {
"5"}}, {{
"hexagonv55"}, {
"55"}},
150 {{
"hexagonv60"}, {
"60"}}, {{
"hexagonv62"}, {
"62"}},
151 {{
"hexagonv65"}, {
"65"}}, {{
"hexagonv66"}, {
"66"}},
159 return Item->
Suffix.data();
165 Values.push_back(Suffix.Name);
Defines the clang::MacroBuilder utility class.
static const char * getHexagonCPUSuffix(StringRef Name)
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
Perform initialization based on the user configured set of features (e.g., +sse4).
Concrete class used by the front-end to report problems and issues.
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeaturesVec) const override
Initialize the map with the default set of target features for the CPU this should include all legal ...
llvm::StringLiteral Suffix
virtual bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
Initialize the map with the default set of target features for the CPU this should include all legal ...
ArrayRef< const char * > getGCCRegNames() const override
float __ovld __cnfn length(float p)
Return the length of vector p, i.e., sqrt(p.x2 + p.y 2 + ...)
Enumerates target-specific builtins in their own namespaces within namespace clang.
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Dataflow Directional Tag Classes.
void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values to setCPU.
static constexpr CPUSuffix Suffixes[]
void defineMacro(const Twine &Name, const Twine &Value="1")
Append a #define line for macro of the form "\#define Name Value\n".
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods --------------------——===//