aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Basic/TargetInfo.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-03-20 11:40:34 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-05-14 11:43:05 +0000
commit349cc55c9796c4596a5b9904cd3281af295f878f (patch)
tree410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/clang/lib/Basic/TargetInfo.cpp
parentcb2ae6163174b90e999326ecec3699ee093a5d43 (diff)
parentc0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff)
Diffstat (limited to 'contrib/llvm-project/clang/lib/Basic/TargetInfo.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Basic/TargetInfo.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/contrib/llvm-project/clang/lib/Basic/TargetInfo.cpp b/contrib/llvm-project/clang/lib/Basic/TargetInfo.cpp
index 5f8e04c2bd6c..646bbe8b7387 100644
--- a/contrib/llvm-project/clang/lib/Basic/TargetInfo.cpp
+++ b/contrib/llvm-project/clang/lib/Basic/TargetInfo.cpp
@@ -34,8 +34,11 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
NoAsmVariants = false;
HasLegalHalfType = false;
HasFloat128 = false;
+ HasIbm128 = false;
HasFloat16 = false;
HasBFloat16 = false;
+ HasLongDouble = true;
+ HasFPReturn = true;
HasStrictFP = false;
PointerWidth = PointerAlign = 32;
BoolWidth = BoolAlign = 8;
@@ -83,6 +86,7 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
LongDoubleWidth = 64;
LongDoubleAlign = 64;
Float128Align = 128;
+ Ibm128Align = 128;
LargeArrayMinWidth = 0;
LargeArrayAlign = 0;
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 0;
@@ -113,6 +117,7 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
DoubleFormat = &llvm::APFloat::IEEEdouble();
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
Float128Format = &llvm::APFloat::IEEEquad();
+ Ibm128Format = &llvm::APFloat::PPCDoubleDouble();
MCountName = "mcount";
UserLabelPrefix = "_";
RegParmMax = 0;
@@ -276,32 +281,36 @@ TargetInfo::IntType TargetInfo::getLeastIntTypeByWidth(unsigned BitWidth,
return NoInt;
}
-TargetInfo::RealType TargetInfo::getRealTypeByWidth(unsigned BitWidth,
- bool ExplicitIEEE) const {
+FloatModeKind TargetInfo::getRealTypeByWidth(unsigned BitWidth,
+ FloatModeKind ExplicitType) const {
if (getFloatWidth() == BitWidth)
- return Float;
+ return FloatModeKind::Float;
if (getDoubleWidth() == BitWidth)
- return Double;
+ return FloatModeKind::Double;
switch (BitWidth) {
case 96:
if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended())
- return LongDouble;
+ return FloatModeKind::LongDouble;
break;
case 128:
// The caller explicitly asked for an IEEE compliant type but we still
// have to check if the target supports it.
- if (ExplicitIEEE)
- return hasFloat128Type() ? Float128 : NoFloat;
+ if (ExplicitType == FloatModeKind::Float128)
+ return hasFloat128Type() ? FloatModeKind::Float128
+ : FloatModeKind::NoFloat;
+ if (ExplicitType == FloatModeKind::Ibm128)
+ return hasIbm128Type() ? FloatModeKind::Ibm128
+ : FloatModeKind::NoFloat;
if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble() ||
&getLongDoubleFormat() == &llvm::APFloat::IEEEquad())
- return LongDouble;
+ return FloatModeKind::LongDouble;
if (hasFloat128Type())
- return Float128;
+ return FloatModeKind::Float128;
break;
}
- return NoFloat;
+ return FloatModeKind::NoFloat;
}
/// getTypeAlign - Return the alignment (in bits) of the specified integer type
@@ -406,7 +415,7 @@ void TargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts) {
// for OpenCL C 2.0 but with no access to target capabilities. Target
// should be immutable once created and thus these language options need
// to be defined only once.
- if (Opts.OpenCLVersion == 300) {
+ if (Opts.getOpenCLCompatibleVersion() == 300) {
const auto &OpenCLFeaturesMap = getSupportedOpenCLOpts();
Opts.OpenCLGenericAddressSpace = hasFeatureEnabled(
OpenCLFeaturesMap, "__opencl_c_generic_address_space");