18#include "llvm/ADT/StringExtras.h"
19#include "llvm/ADT/StringSwitch.h"
29#define BUILTIN CLANG_BUILTIN_STR_TABLE
30#define TARGET_BUILTIN CLANG_TARGET_BUILTIN_STR_TABLE
31#include "clang/Basic/BuiltinsSystemZ.def"
35#define BUILTIN CLANG_BUILTIN_ENTRY
36#define TARGET_BUILTIN CLANG_TARGET_BUILTIN_ENTRY
37#include "clang/Basic/BuiltinsSystemZ.def"
40const char *
const SystemZTargetInfo::GCCRegNames[] = {
41 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
42 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
43 "f0",
"f2",
"f4",
"f6",
"f1",
"f3",
"f5",
"f7",
44 "f8",
"f10",
"f12",
"f14",
"f9",
"f11",
"f13",
"f15",
45 "",
"cc",
"",
"",
"a0",
"a1",
46 "v16",
"v18",
"v20",
"v22",
"v17",
"v19",
"v21",
"v23",
47 "v24",
"v26",
"v28",
"v30",
"v25",
"v27",
"v29",
"v31"
51 {{
"v0"}, 16}, {{
"v2"}, 17}, {{
"v4"}, 18}, {{
"v6"}, 19},
52 {{
"v1"}, 20}, {{
"v3"}, 21}, {{
"v5"}, 22}, {{
"v7"}, 23},
53 {{
"v8"}, 24}, {{
"v10"}, 25}, {{
"v12"}, 26}, {{
"v14"}, 27},
54 {{
"v9"}, 28}, {{
"v11"}, 29}, {{
"v13"}, 30}, {{
"v15"}, 31}
110 {{
"arch8"}, 8}, {{
"z10"}, 8},
111 {{
"arch9"}, 9}, {{
"z196"}, 9},
112 {{
"arch10"}, 10}, {{
"zEC12"}, 10},
113 {{
"arch11"}, 11}, {{
"z13"}, 11},
114 {{
"arch12"}, 12}, {{
"z14"}, 12},
115 {{
"arch13"}, 13}, {{
"z15"}, 13},
116 {{
"arch14"}, 14}, {{
"z16"}, 14},
117 {{
"arch15"}, 15}, {{
"z17"}, 15},
123 return CR.
Name == Name;
127 return Rev->ISARevisionID;
133 Values.push_back(Rev.Name);
137 return llvm::StringSwitch<bool>(
Feature)
138 .Case(
"systemz",
true)
139 .Case(
"arch8", ISARevision >= 8)
140 .Case(
"arch9", ISARevision >= 9)
141 .Case(
"arch10", ISARevision >= 10)
142 .Case(
"arch11", ISARevision >= 11)
143 .Case(
"arch12", ISARevision >= 12)
144 .Case(
"arch13", ISARevision >= 13)
145 .Case(
"arch14", ISARevision >= 14)
146 .Case(
"arch15", ISARevision >= 15)
147 .Case(
"htm", HasTransactionalExecution)
148 .Case(
"vx", HasVector)
153 bool HasNonWeakDef)
const {
156 if (UnalignedSymbols && !HasNonWeakDef)
164 Builder.defineMacro(
"__s390__");
165 Builder.defineMacro(
"__s390x__");
166 Builder.defineMacro(
"__zarch__");
167 Builder.defineMacro(
"__LONG_DOUBLE_128__");
169 Builder.defineMacro(
"__ARCH__", Twine(ISARevision));
171 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
172 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
173 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
174 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
176 if (HasTransactionalExecution)
177 Builder.defineMacro(
"__HTM__");
179 Builder.defineMacro(
"__VX__");
181 Builder.defineMacro(
"__VEC__",
"10305");
185 if (!
getTriple().getOSVersion().empty()) {
186 llvm::VersionTuple
V =
getTriple().getOSVersion();
188 std::string Str(
"0x");
189 unsigned int Librel = 0x40000000;
190 Librel |=
V.getMajor() << 24;
191 Librel |=
V.getMinor().value_or(1) << 16;
192 Librel |=
V.getSubminor().value_or(0);
193 Str += llvm::utohexstr(Librel);
195 Builder.defineMacro(
"__TARGET_LIB__", Str.c_str());
static constexpr llvm::StringTable BuiltinStrings
const TargetInfo::AddlRegName GCCAddlRegNames[]
static constexpr ISANameRevision ISARevisions[]
static constexpr Builtin::Info BuiltinInfos[]
static constexpr unsigned NumBuiltins
Defines enum values for all the target-independent builtin functions.
#define CLANG_BUILTIN_STR_TABLE_START
Defines the clang::LangOptions interface.
Defines the clang::MacroBuilder utility class.
Enumerates target-specific builtins in their own namespaces within namespace clang.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
unsigned getMinGlobalAlign(uint64_t Size, bool HasNonWeakDef) const override
getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explic...
llvm::SmallVector< Builtin::InfosShard > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
ArrayRef< TargetInfo::AddlRegName > getGCCAddlRegNames() const override
ArrayRef< const char * > getGCCRegNames() const override
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
int getISARevision(StringRef Name) const
void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values to setCPU.
static constexpr std::array< Info, N > MakeInfos(std::array< Info, N > Infos)
A constexpr function to construct an infos array from X-macros.
The JSON file list parser is used to communicate input to InstallAPI.
unsigned char MinGlobalAlign