13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_SYSTEMZ_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_SYSTEMZ_H
18#include "llvm/Support/Compiler.h"
19#include "llvm/TargetParser/Triple.h"
51 static const char *
const GCCRegNames[];
53 bool HasTransactionalExecution;
56 bool UnalignedSymbols;
57 enum AddrSpace { ptr32 = 1 };
61 :
TargetInfo(Triple), ISARevision(getISARevision(
"z10")),
63 UnalignedSymbols(
false) {
64 IntMaxType = SignedLong;
65 Int64Type = SignedLong;
66 IntWidth = IntAlign = 32;
67 LongWidth = LongLongWidth = LongAlign = LongLongAlign = 64;
69 PointerWidth = PointerAlign = 64;
70 LongDoubleWidth = 128;
72 LongDoubleFormat = &llvm::APFloat::IEEEquad();
73 DefaultAlignForAttributeAligned = 64;
75 HasUnalignedAccess =
true;
76 if (Triple.isOSzOS()) {
77 if (Triple.isArch64Bit()) {
87 resetDataLayout(
"E-m:l-p1:32:32-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-"
91 resetDataLayout(
"E-m:e-i1:8:16-i8:8:16-i64:64-f128:64"
92 "-v128:64-a:8:16-n32:64");
94 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 128;
98 unsigned getMinGlobalAlign(uint64_t Size,
bool HasNonWeakDef)
const override;
115 return RegName ==
"r15";
118 bool validateAsmConstraint(
const char *&Name,
122 switch (Constraint[0]) {
124 return std::string(
"p");
126 switch (Constraint[1]) {
134 return std::string(
"^") + std::string(Constraint++, 2);
142 return TargetInfo::convertConstraint(Constraint);
151 return TargetInfo::SystemZBuiltinVaList;
154 int getISARevision(StringRef Name)
const;
157 return getISARevision(Name) != -1;
163 return isValidCPUName(Name);
167 fillValidCPUList(Values);
170 bool setCPU(
const std::string &Name)
override {
171 ISARevision = getISARevision(Name);
172 return ISARevision != -1;
178 const std::vector<std::string> &FeaturesVec)
const override {
179 int ISARevision = getISARevision(CPU);
180 if (ISARevision >= 10)
181 Features[
"transactional-execution"] =
true;
182 if (ISARevision >= 11)
183 Features[
"vector"] =
true;
184 if (ISARevision >= 12)
185 Features[
"vector-enhancements-1"] =
true;
186 if (ISARevision >= 13)
187 Features[
"vector-enhancements-2"] =
true;
188 if (ISARevision >= 14)
189 Features[
"nnp-assist"] =
true;
190 if (ISARevision >= 15) {
191 Features[
"miscellaneous-extensions-4"] =
true;
192 Features[
"vector-enhancements-3"] =
true;
194 return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
199 HasTransactionalExecution =
false;
202 UnalignedSymbols =
false;
203 for (
const auto &Feature : Features) {
204 if (Feature ==
"+transactional-execution")
205 HasTransactionalExecution =
true;
206 else if (Feature ==
"+vector")
208 else if (Feature ==
"+soft-float")
210 else if (Feature ==
"+unaligned-symbols")
211 UnalignedSymbols =
true;
213 HasVector &= !SoftFloat;
220 if (HasVector && !getTriple().isOSzOS())
226 bool hasFeature(StringRef Feature)
const override;
252 return RegNo < 4 ? 6 + RegNo : -1;
258 return std::make_pair(256, 256);
261 return (getTriple().isOSzOS() && getTriple().isArch64Bit() &&
262 getTargetAddressSpace(AddrSpace) == ptr32)
268 return getPointerWidthV(AddrSpace);
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature.
Defines the clang::TargetOptions class.
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...
Exposes information about the current target.
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Options for controlling the target.
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
const char * getLongDoubleMangling() const override
Return the mangled code of long double.
uint64_t getPointerAlignV(LangAS AddrSpace) const override
bool isSPRegName(StringRef RegName) const override
std::string convertConstraint(const char *&Constraint) const override
bool isValidCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name.
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
Perform initialization based on the user configured set of features (e.g., +sse4).
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
bool hasSjLjLowering() const override
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm....
bool setCPU(const std::string &Name) override
Target the specified CPU.
std::pair< unsigned, unsigned > hardwareInterferenceSizes() const override
The first value in the pair is the minimum offset between two objects to avoid false sharing (destruc...
void fillValidTuneCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values for tuning CPU.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
uint64_t getPointerWidthV(LangAS AddrSpace) const override
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
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 ...
StringRef getABI() const override
Get the ABI currently in use.
bool isValidTuneCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name for tuning.
SystemZTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Defines the clang::TargetInfo interface.
static const unsigned ZOSAddressMap[]
The JSON file list parser is used to communicate input to InstallAPI.
LangAS
Defines the address space values used by the address space qualifier of QualType.
CallingConv
CallingConv - Specifies the calling convention that a function uses.