Skip to content

Commit 0d346ff

Browse files
committed
Rename HasFastHalfType -> HasFastScalarHalfType
1 parent 916006a commit 0d346ff

File tree

15 files changed

+40
-41
lines changed

15 files changed

+40
-41
lines changed

clang/include/clang/Basic/TargetInfo.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ class TargetInfo : public TransferrableTargetInfo,
233233
bool TLSSupported;
234234
bool VLASupported;
235235
bool NoAsmVariants; // True if {|} are normal characters.
236-
bool HasFastHalfType; // True if the backend has native half float support,
237-
// and performing calculations in float instead does
238-
// not have a performance advantage.
236+
bool HasFastScalarHalfType; // True if the backend has native scalar half
237+
// float support, and performing calculations in
238+
// float instead does not have a performance
239+
// advantage.
239240
bool HalfArgsAndReturns; // OpenCL 6.1.1.1, NEON (IEEE 754-2008 half) type.
240241
bool HasFloat128;
241242
bool HasFloat16;
@@ -702,8 +703,8 @@ class TargetInfo : public TransferrableTargetInfo,
702703
}
703704

704705
/// Determine whether the target has fast native support for operations
705-
/// on half types.
706-
virtual bool hasFastHalfType() const { return HasFastHalfType; }
706+
/// on scalar half types.
707+
virtual bool hasFastScalarHalfType() const { return HasFastScalarHalfType; }
707708

708709
/// Whether half args and returns are supported.
709710
virtual bool allowHalfArgsAndReturns() const { return HalfArgsAndReturns; }

clang/lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ bool QualType::UseExcessPrecision(const ASTContext &Ctx) {
16271627
switch (BT->getKind()) {
16281628
case BuiltinType::Kind::Float16: {
16291629
const TargetInfo &TI = Ctx.getTargetInfo();
1630-
if (TI.hasFloat16Type() && !TI.hasFastHalfType() &&
1630+
if (TI.hasFloat16Type() && !TI.hasFastScalarHalfType() &&
16311631
Ctx.getLangOpts().getFloat16ExcessPrecision() !=
16321632
Ctx.getLangOpts().ExcessPrecisionKind::FPP_None)
16331633
return true;

clang/lib/Basic/TargetInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : Triple(T) {
6262
TLSSupported = true;
6363
VLASupported = true;
6464
NoAsmVariants = false;
65-
HasFastHalfType = false;
65+
HasFastScalarHalfType = false;
6666
HalfArgsAndReturns = false;
6767
HasFloat128 = false;
6868
HasIbm128 = false;

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ AArch64TargetInfo::AArch64TargetInfo(const llvm::Triple &Triple,
142142
AddrSpaceMap = &ARM64AddrSpaceMap;
143143

144144
// All AArch64 implementations support ARMv8 FP, which makes half a legal type.
145-
HasFastHalfType = true;
145+
HasFastScalarHalfType = true;
146146
HalfArgsAndReturns = true;
147147
HasFloat16 = true;
148148
HasStrictFP = true;

clang/lib/Basic/Targets/AMDGPU.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ AMDGPUTargetInfo::AMDGPUTargetInfo(const llvm::Triple &Triple,
251251
BFloat16Format = &llvm::APFloat::BFloat();
252252
}
253253

254-
HasFastHalfType = true;
254+
HasFastScalarHalfType = true;
255255
HasFloat16 = true;
256256
WavefrontSize = (GPUFeatures & llvm::AMDGPU::FEATURE_WAVE32) ? 32 : 64;
257257

clang/lib/Basic/Targets/ARM.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,13 +585,13 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
585585
} else if (Feature == "+fp16") {
586586
HW_FP |= HW_FP_HP;
587587
} else if (Feature == "+fullfp16") {
588-
HasFastHalfType = true;
588+
HasFastScalarHalfType = true;
589589
} else if (Feature == "+dotprod") {
590590
DotProd = true;
591591
} else if (Feature == "+mve") {
592592
MVE |= MVE_INT;
593593
} else if (Feature == "+mve.fp") {
594-
HasFastHalfType = true;
594+
HasFastScalarHalfType = true;
595595
FPU |= FPARMV8;
596596
MVE |= MVE_INT | MVE_FP;
597597
HW_FP |= HW_FP_SP | HW_FP_HP;
@@ -1014,11 +1014,11 @@ void ARMTargetInfo::getTargetDefines(const LangOptions &Opts,
10141014
Builder.defineMacro("__ARM_FP_FAST", "1");
10151015

10161016
// Armv8.2-A FP16 vector intrinsic
1017-
if ((FPU & NeonFPU) && HasFastHalfType)
1017+
if ((FPU & NeonFPU) && HasFastScalarHalfType)
10181018
Builder.defineMacro("__ARM_FEATURE_FP16_VECTOR_ARITHMETIC", "1");
10191019

10201020
// Armv8.2-A FP16 scalar intrinsics
1021-
if (HasFastHalfType)
1021+
if (HasFastScalarHalfType)
10221022
Builder.defineMacro("__ARM_FEATURE_FP16_SCALAR_ARITHMETIC", "1");
10231023

10241024
// Armv8.2-A dot product intrinsics

clang/lib/Basic/Targets/DirectX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class LLVM_LIBRARY_VISIBILITY DirectXTargetInfo : public TargetInfo {
5959
VLASupported = false;
6060
AddrSpaceMap = &DirectXAddrSpaceMap;
6161
UseAddrSpaceMapMangling = true;
62-
HasFastHalfType = true;
62+
HasFastScalarHalfType = true;
6363
HasFloat16 = true;
6464
NoAsmVariants = true;
6565
PlatformMinVersion = Triple.getOSVersion();

clang/lib/Basic/Targets/Hexagon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ bool HexagonTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
149149
HasAudio = true;
150150
}
151151
if (CPU.compare("hexagonv68") >= 0) {
152-
HasFastHalfType = true;
152+
HasFastScalarHalfType = true;
153153
HasFloat16 = true;
154154
}
155155
return true;

clang/lib/Basic/Targets/NVPTX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ NVPTXTargetInfo::NVPTXTargetInfo(const llvm::Triple &Triple,
6565
GPU = OffloadArch::UNUSED;
6666

6767
// PTX supports f16 as a fundamental type.
68-
HasFastHalfType = true;
68+
HasFastScalarHalfType = true;
6969
HasFloat16 = true;
7070

7171
if (TargetPointerWidth == 32)

clang/lib/Basic/Targets/RISCV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ bool RISCVTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
427427
ABI = ISAInfo->computeDefaultABI().str();
428428

429429
if (ISAInfo->hasExtension("zfh") || ISAInfo->hasExtension("zhinx"))
430-
HasFastHalfType = true;
430+
HasFastScalarHalfType = true;
431431

432432
FastScalarUnalignedAccess =
433433
llvm::is_contained(Features, "+unaligned-scalar-mem");

0 commit comments

Comments
 (0)