Skip to content

Commit

Permalink
[AArch64]: Refactor target parser to use Bitset. (#65423)
Browse files Browse the repository at this point in the history
Use Bitset instead of BitMasking for the Architecture Extensions,
as the number of extensions will exceed the bitmask bits eventually.
  • Loading branch information
hassnaaHamdi committed Sep 12, 2023
1 parent bfddbda commit 491a1cd
Show file tree
Hide file tree
Showing 5 changed files with 1,103 additions and 913 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Basic/Targets/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ bool AArch64TargetInfo::initFeatureMap(
// Parse the CPU and add any implied features.
std::optional<llvm::AArch64::CpuInfo> CpuInfo = llvm::AArch64::parseCpu(CPU);
if (CpuInfo) {
uint64_t Exts = CpuInfo->getImpliedExtensions();
llvm::Bitset Exts = CpuInfo->getImpliedExtensions();
std::vector<StringRef> CPUFeats;
llvm::AArch64::getExtensionFeatures(Exts, CPUFeats);
for (auto F : CPUFeats) {
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains/Arch/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static bool DecodeAArch64Mcpu(const Driver &D, StringRef Mcpu, StringRef &CPU,

Features.push_back(ArchInfo->ArchFeature);

uint64_t Extension = CpuInfo->getImpliedExtensions();
llvm::Bitset Extension = CpuInfo->getImpliedExtensions();
if (!llvm::AArch64::getExtensionFeatures(Extension, Features))
return false;
}
Expand Down

0 comments on commit 491a1cd

Please sign in to comment.