13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_HEXAGON_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_HEXAGON_H
18#include "llvm/Support/Compiler.h"
19#include "llvm/TargetParser/Triple.h"
28 static const char *
const GCCRegNames[];
31 std::string HVXVersion;
33 bool HasHVX64B =
false;
34 bool HasHVX128B =
false;
35 bool HasAudio =
false;
36 bool UseLongCalls =
false;
45 "e-m:e-p:32:32:32-a:0-n16:32-"
46 "i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-"
47 "v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048");
48 SizeType = UnsignedInt;
49 PtrDiffType = SignedInt;
50 IntPtrType = SignedInt;
56 LargeArrayMinWidth = 64;
58 UseBitFieldTypeAlignment =
true;
59 ZeroLengthBitfieldBoundary = 32;
60 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
66 BoolWidth = BoolAlign = 8;
96 bool hasFeature(StringRef Feature)
const override;
101 const std::vector<std::string> &FeaturesVec)
const override;
103 bool handleTargetFeatures(std::vector<std::string> &Features,
107 if (getTriple().isMusl())
108 return TargetInfo::HexagonBuiltinVaList;
109 return TargetInfo::CharPtrBuiltinVaList;
118 static const char *getHexagonCPUSuffix(StringRef Name);
119 static std::optional<unsigned> getHexagonCPURev(StringRef Name);
122 return getHexagonCPUSuffix(Name);
127 bool setCPU(
const std::string &Name)
override {
128 if (!isValidCPUName(Name))
135 return RegNo < 2 ? RegNo : -1;
140 return CPU.find(
't') != std::string::npos;
146 std::optional<unsigned> Rev = getHexagonCPURev(CPU);
149 unsigned CacheLineSizeBytes = Rev >= 73U ? 64 : 32;
150 return std::make_pair(CacheLineSizeBytes, CacheLineSizeBytes);
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.
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
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...
HexagonTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
bool setCPU(const std::string &Name) override
Target the specified CPU.
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
bool isValidCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name.
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
bool isCLZForZeroUndef() const override
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.