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"
26 static const char *
const GCCRegNames[];
29 bool HasTransactionalExecution;
35 :
TargetInfo(Triple), CPU(
"z10"), ISARevision(8),
37 IntMaxType = SignedLong;
38 Int64Type = SignedLong;
40 IntWidth = IntAlign = 32;
41 LongWidth = LongLongWidth = LongAlign = LongLongAlign = 64;
43 PointerWidth = PointerAlign = 64;
44 LongDoubleWidth = 128;
46 LongDoubleFormat = &llvm::APFloat::IEEEquad();
47 DefaultAlignForAttributeAligned = 64;
49 if (Triple.isOSzOS()) {
56 "E-m:l-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64");
58 resetDataLayout(
"E-m:e-i1:8:16-i8:8:16-i64:64-f128:64"
59 "-v128:64-a:8:16-n32:64");
60 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
79 return RegName.equals(
"r15");
82 bool validateAsmConstraint(
const char *&Name,
86 switch (Constraint[0]) {
88 return std::string(
"p");
90 switch (Constraint[1]) {
98 return std::string(
"^") + std::string(Constraint++, 2);
106 return TargetInfo::convertConstraint(Constraint);
115 return TargetInfo::SystemZBuiltinVaList;
118 int getISARevision(StringRef Name)
const;
121 return getISARevision(Name) != -1;
127 return isValidCPUName(Name);
131 fillValidCPUList(Values);
134 bool setCPU(
const std::string &Name)
override {
136 ISARevision = getISARevision(CPU);
137 return ISARevision != -1;
143 const std::vector<std::string> &FeaturesVec)
const override {
144 int ISARevision = getISARevision(CPU);
145 if (ISARevision >= 10)
146 Features[
"transactional-execution"] =
true;
147 if (ISARevision >= 11)
148 Features[
"vector"] =
true;
149 if (ISARevision >= 12)
150 Features[
"vector-enhancements-1"] =
true;
151 if (ISARevision >= 13)
152 Features[
"vector-enhancements-2"] =
true;
153 if (ISARevision >= 14)
154 Features[
"nnp-assist"] =
true;
155 return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
160 HasTransactionalExecution =
false;
163 for (
const auto &Feature : Features) {
164 if (Feature ==
"+transactional-execution")
165 HasTransactionalExecution =
true;
166 else if (Feature ==
"+vector")
168 else if (Feature ==
"+soft-float")
171 HasVector &= !SoftFloat;
178 if (HasVector && !getTriple().isOSzOS())
184 bool hasFeature(StringRef Feature)
const override;
210 return RegNo < 4 ? 6 + RegNo : -1;
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.
bool isSPRegName(StringRef RegName) const override
std::string convertConstraint(const char *&Constraint) const override
bool isValidCPUName(StringRef Name) const override
brief 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 setCPU(const std::string &Name) override
Target the specified CPU.
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.
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
brief Determine whether this TargetInfo supports the given CPU name for
SystemZTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Defines the clang::TargetInfo interface.
CallingConv
CallingConv - Specifies the calling convention that a function uses.