18#include "llvm/ADT/StringExtras.h"
19#include "llvm/ADT/StringSwitch.h"
29#define GET_BUILTIN_STR_TABLE
30#include "clang/Basic/BuiltinsSystemZ.inc"
31#undef GET_BUILTIN_STR_TABLE
34#define GET_BUILTIN_INFOS
35#include "clang/Basic/BuiltinsSystemZ.inc"
36#undef GET_BUILTIN_INFOS
40#define GET_BUILTIN_PREFIXED_INFOS
41#include "clang/Basic/BuiltinsSystemZ.inc"
42#undef GET_BUILTIN_PREFIXED_INFOS
48#define GET_BUILTIN_STR_TABLE
49#include "clang/Basic/BuiltinsZOS.inc"
50#undef GET_BUILTIN_STR_TABLE
53#define GET_BUILTIN_INFOS
54#include "clang/Basic/BuiltinsZOS.inc"
55#undef GET_BUILTIN_INFOS
61const char *
const SystemZTargetInfo::GCCRegNames[] = {
62 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
63 "r8",
"r9",
"r10",
"r11",
"r12",
"r13",
"r14",
"r15",
64 "f0",
"f2",
"f4",
"f6",
"f1",
"f3",
"f5",
"f7",
65 "f8",
"f10",
"f12",
"f14",
"f9",
"f11",
"f13",
"f15",
66 "",
"cc",
"",
"",
"a0",
"a1",
67 "v16",
"v18",
"v20",
"v22",
"v17",
"v19",
"v21",
"v23",
68 "v24",
"v26",
"v28",
"v30",
"v25",
"v27",
"v29",
"v31"
72 {{
"v0"}, 16}, {{
"v2"}, 17}, {{
"v4"}, 18}, {{
"v6"}, 19},
73 {{
"v1"}, 20}, {{
"v3"}, 21}, {{
"v5"}, 22}, {{
"v7"}, 23},
74 {{
"v8"}, 24}, {{
"v10"}, 25}, {{
"v12"}, 26}, {{
"v14"}, 27},
75 {{
"v9"}, 28}, {{
"v11"}, 29}, {{
"v13"}, 30}, {{
"v15"}, 31}
125 if (StringRef(Name) ==
"@cc") {
141 {{
"arch8"}, 8}, {{
"z10"}, 8},
142 {{
"arch9"}, 9}, {{
"z196"}, 9},
143 {{
"arch10"}, 10}, {{
"zEC12"}, 10},
144 {{
"arch11"}, 11}, {{
"z13"}, 11},
145 {{
"arch12"}, 12}, {{
"z14"}, 12},
146 {{
"arch13"}, 13}, {{
"z15"}, 13},
147 {{
"arch14"}, 14}, {{
"z16"}, 14},
148 {{
"arch15"}, 15}, {{
"z17"}, 15},
154 return CR.
Name == Name;
158 return Rev->ISARevisionID;
164 Values.push_back(Rev.Name);
168 return llvm::StringSwitch<bool>(
Feature)
169 .Case(
"systemz",
true)
170 .Case(
"arch8", ISARevision >= 8)
171 .Case(
"arch9", ISARevision >= 9)
172 .Case(
"arch10", ISARevision >= 10)
173 .Case(
"arch11", ISARevision >= 11)
174 .Case(
"arch12", ISARevision >= 12)
175 .Case(
"arch13", ISARevision >= 13)
176 .Case(
"arch14", ISARevision >= 14)
177 .Case(
"arch15", ISARevision >= 15)
178 .Case(
"htm", HasTransactionalExecution)
179 .Case(
"vx", HasVector)
184 bool HasNonWeakDef)
const {
187 if (UnalignedSymbols && !HasNonWeakDef)
196 Builder.defineMacro(
"__GCC_ASM_FLAG_OUTPUTS__");
198 Builder.defineMacro(
"__s390__");
199 Builder.defineMacro(
"__s390x__");
200 Builder.defineMacro(
"__zarch__");
201 Builder.defineMacro(
"__LONG_DOUBLE_128__");
203 Builder.defineMacro(
"__ARCH__", Twine(ISARevision));
205 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
206 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
207 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
208 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
210 if (HasTransactionalExecution)
211 Builder.defineMacro(
"__HTM__");
213 Builder.defineMacro(
"__VX__");
215 Builder.defineMacro(
"__VEC__",
"10305");
219 if (!
getTriple().getOSVersion().empty()) {
220 llvm::VersionTuple
V =
getTriple().getOSVersion();
222 std::string Str(
"0x");
223 unsigned int Librel = 0x40000000;
224 Librel |=
V.getMajor() << 24;
225 Librel |=
V.getMinor().value_or(1) << 16;
226 Librel |=
V.getSubminor().value_or(0);
227 Str += llvm::utohexstr(Librel);
229 Builder.defineMacro(
"__TARGET_LIB__", Str);
static constexpr llvm::StringTable BuiltinStrings
static constexpr Builtin::Info PrefixedBuiltinInfos[]
const TargetInfo::AddlRegName GCCAddlRegNames[]
static constexpr int NumBuiltinsZOS
static constexpr ISANameRevision ISARevisions[]
static constexpr Builtin::Info BuiltinInfos[]
static constexpr unsigned NumBuiltins
Defines enum values for all the target-independent builtin functions.
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 Builtin::Info BuiltinInfos[]
The JSON file list parser is used to communicate input to InstallAPI.
The info used to represent each builtin.
void setOutputOperandBounds(unsigned Min, unsigned Max)
unsigned char MinGlobalAlign