Skip to content

[Clang] Remove AArch64TargetInfo::setArchFeatures #146107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions clang/lib/Basic/Targets/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,79 +125,6 @@ static constexpr auto BuiltinAArch64Infos =
#include "clang/Basic/BuiltinsAArch64.def"
});

void AArch64TargetInfo::setArchFeatures() {
if (*ArchInfo == llvm::AArch64::ARMV8R) {
HasDotProd = true;
HasDIT = true;
HasFlagM = true;
HasRCPC = true;
FPU |= NeonMode;
HasCCPP = true;
HasCRC = true;
HasLSE = true;
HasRDM = true;
} else if (ArchInfo->Version.getMajor() == 8) {
if (ArchInfo->Version.getMinor() >= 7u) {
HasWFxT = true;
}
if (ArchInfo->Version.getMinor() >= 6u) {
HasBFloat16 = true;
HasMatMul = true;
}
if (ArchInfo->Version.getMinor() >= 5u) {
HasAlternativeNZCV = true;
HasFRInt3264 = true;
HasSSBS = true;
HasSB = true;
HasPredRes = true;
HasBTI = true;
}
if (ArchInfo->Version.getMinor() >= 4u) {
HasDotProd = true;
HasDIT = true;
HasFlagM = true;
}
if (ArchInfo->Version.getMinor() >= 3u) {
HasRCPC = true;
FPU |= NeonMode;
}
if (ArchInfo->Version.getMinor() >= 2u) {
HasCCPP = true;
}
if (ArchInfo->Version.getMinor() >= 1u) {
HasCRC = true;
HasLSE = true;
HasRDM = true;
}
} else if (ArchInfo->Version.getMajor() == 9) {
if (ArchInfo->Version.getMinor() >= 2u) {
HasWFxT = true;
}
if (ArchInfo->Version.getMinor() >= 1u) {
HasBFloat16 = true;
HasMatMul = true;
}
FPU |= SveMode;
HasSVE2 = true;
HasFullFP16 = true;
HasAlternativeNZCV = true;
HasFRInt3264 = true;
HasSSBS = true;
HasSB = true;
HasPredRes = true;
HasBTI = true;
HasDotProd = true;
HasDIT = true;
HasFlagM = true;
HasRCPC = true;
FPU |= NeonMode;
HasCCPP = true;
HasCRC = true;
HasLSE = true;
HasRDM = true;
}
}

AArch64TargetInfo::AArch64TargetInfo(const llvm::Triple &Triple,
const TargetOptions &Opts)
: TargetInfo(Triple), ABI("aapcs") {
Expand Down Expand Up @@ -1266,7 +1193,6 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
}

setDataLayout();
setArchFeatures();

if (HasNoFP) {
FPU &= ~FPUMode;
Expand Down
2 changes: 0 additions & 2 deletions clang/lib/Basic/Targets/AArch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
return false;
}

void setArchFeatures();

void getTargetDefinesARMV81A(const LangOptions &Opts,
MacroBuilder &Builder) const;
void getTargetDefinesARMV82A(const LangOptions &Opts,
Expand Down
5 changes: 5 additions & 0 deletions clang/test/Preprocessor/arm-target-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,3 +1049,8 @@
// CHECK-NOSIMD-NOT: #define __ARM_NEON 1
// CHECK-NOSIMD-NOT: #define __ARM_NEON_FP 0x6
// CHECK-NOSIMD-NOT: #define __ARM_NEON__ 1

// Check that disabling SVE, as set by armv9-a, does not define __ARM_FEATURE_SVE* macros.
// RUN: %clang -target aarch64 -march=armv9-a+nosve -x c -E -dM -o - %s | FileCheck -check-prefix=CHECK-NOSVE %s
// CHECK-NOSVE-NOT: #define __ARM_FEATURE_SVE 1
// CHECK-NOSVE-NOT: #define __ARM_FEATURE_SVE2 1
Loading