diff options
Diffstat (limited to 'utils/TableGen/SubtargetFeatureInfo.cpp')
-rw-r--r-- | utils/TableGen/SubtargetFeatureInfo.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/utils/TableGen/SubtargetFeatureInfo.cpp b/utils/TableGen/SubtargetFeatureInfo.cpp index f9b8853cc117..edf0b4a01c6d 100644 --- a/utils/TableGen/SubtargetFeatureInfo.cpp +++ b/utils/TableGen/SubtargetFeatureInfo.cpp @@ -1,9 +1,8 @@ //===- SubtargetFeatureInfo.cpp - Helpers for subtarget features ----------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -45,20 +44,6 @@ SubtargetFeatureInfo::getAll(const RecordKeeper &Records) { return SubtargetFeatures; } -void SubtargetFeatureInfo::emitSubtargetFeatureFlagEnumeration( - SubtargetFeatureInfoMap &SubtargetFeatures, raw_ostream &OS) { - OS << "// Flags for subtarget features that participate in " - << "instruction matching.\n"; - OS << "enum SubtargetFeatureFlag : " - << getMinimalTypeForEnumBitfield(SubtargetFeatures.size()) << " {\n"; - for (const auto &SF : SubtargetFeatures) { - const SubtargetFeatureInfo &SFI = SF.second; - OS << " " << SFI.getEnumName() << " = (1ULL << " << SFI.Index << "),\n"; - } - OS << " Feature_None = 0\n"; - OS << "};\n\n"; -} - void SubtargetFeatureInfo::emitSubtargetFeatureBitEnumeration( SubtargetFeatureInfoMap &SubtargetFeatures, raw_ostream &OS) { OS << "// Bits for subtarget features that participate in " @@ -121,9 +106,9 @@ void SubtargetFeatureInfo::emitComputeAvailableFeatures( void SubtargetFeatureInfo::emitComputeAssemblerAvailableFeatures( StringRef TargetName, StringRef ClassName, StringRef FuncName, SubtargetFeatureInfoMap &SubtargetFeatures, raw_ostream &OS) { - OS << "uint64_t " << TargetName << ClassName << "::\n" + OS << "FeatureBitset " << TargetName << ClassName << "::\n" << FuncName << "(const FeatureBitset& FB) const {\n"; - OS << " uint64_t Features = 0;\n"; + OS << " FeatureBitset Features;\n"; for (const auto &SF : SubtargetFeatures) { const SubtargetFeatureInfo &SFI = SF.second; @@ -157,7 +142,7 @@ void SubtargetFeatureInfo::emitComputeAssemblerAvailableFeatures( } while (true); OS << ")\n"; - OS << " Features |= " << SFI.getEnumName() << ";\n"; + OS << " Features[" << SFI.getEnumBitName() << "] = 1;\n"; } OS << " return Features;\n"; OS << "}\n\n"; |