17#ifndef LLVM_TARGETPARSER_SUBTARGETFEATURE_H
18#define LLVM_TARGETPARSER_SUBTARGETFEATURE_H
25#include <initializer_list>
43 "Should be a multiple of 64!");
44 std::array<uint64_t, MAX_SUBTARGET_WORDS> Bits{};
58 std::fill(std::begin(Bits), std::end(Bits), -1ULL);
79 return (Bits[
I / 64] & Mask) != 0;
82 constexpr bool test(
unsigned I)
const {
return (*
this)[
I]; }
98 for (
unsigned I = 0,
E = Bits.size();
I !=
E; ++
I) {
99 Bits[
I] ^=
RHS.Bits[
I];
110 for (
unsigned I = 0,
E = Bits.size();
I !=
E; ++
I)
111 Bits[
I] &=
RHS.Bits[
I];
121 for (
unsigned I = 0,
E = Bits.size();
I !=
E; ++
I) {
122 Bits[
I] |=
RHS.Bits[
I];
134 for (
auto &
B : Result.Bits)
140 return std::equal(std::begin(Bits), std::end(Bits), std::begin(
RHS.Bits));
146 for (
unsigned I = 0,
E =
size();
I !=
E; ++
I) {
175 std::vector<std::string> Features;
189 const std::vector<std::string> &
getFeatures()
const {
return Features; }
204 char Ch = Feature[0];
206 return Ch ==
'+' || Ch ==
'-';
218 char Ch = Feature[0];
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Class used to store the subtarget bits in the tables created by tablegen.
const FeatureBitset & getAsBitset() const
constexpr FeatureBitArray(const std::array< uint64_t, MAX_SUBTARGET_WORDS > &B)
Container class for subtarget features.
constexpr FeatureBitset(const std::array< uint64_t, MAX_SUBTARGET_WORDS > &B)
constexpr FeatureBitset & operator&=(const FeatureBitset &RHS)
constexpr FeatureBitset & operator|=(const FeatureBitset &RHS)
constexpr FeatureBitset & reset(unsigned I)
constexpr bool operator[](unsigned I) const
constexpr FeatureBitset & operator^=(const FeatureBitset &RHS)
bool operator!=(const FeatureBitset &RHS) const
constexpr FeatureBitset & set(unsigned I)
constexpr bool test(unsigned I) const
constexpr FeatureBitset & flip(unsigned I)
constexpr FeatureBitset()=default
constexpr FeatureBitset operator|(const FeatureBitset &RHS) const
constexpr FeatureBitset(std::initializer_list< unsigned > Init)
constexpr FeatureBitset operator&(const FeatureBitset &RHS) const
bool operator<(const FeatureBitset &Other) const
bool operator==(const FeatureBitset &RHS) const
constexpr FeatureBitset operator~() const
constexpr size_t size() const
constexpr FeatureBitset operator^(const FeatureBitset &RHS) const
StringRef - Represent a constant reference to a string, i.e.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
constexpr bool empty() const
empty - Check if the string is empty.
Manages the enabling and disabling of subtarget specific features.
static void Split(std::vector< std::string > &V, StringRef S)
Splits a string of comma separated items in to a vector of strings.
const std::vector< std::string > & getFeatures() const
Returns the vector of individual subtarget features.
void getDefaultSubtargetFeatures(const Triple &Triple)
Adds the default features for the specified target triple.
static bool hasFlag(StringRef Feature)
Determine if a feature has a flag; '+' or '-'.
static StringRef StripFlag(StringRef Feature)
Return string stripped of flag.
void print(raw_ostream &OS) const
Prints feature string.
std::string getString() const
Returns features as a string.
static bool isEnabled(StringRef Feature)
Return true if enable flag; '+'.
void AddFeature(StringRef String, bool Enable=true)
Adds Features.
void addFeaturesVector(const ArrayRef< std::string > OtherFeatures)
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
const unsigned MAX_SUBTARGET_FEATURES
int popcount(T Value) noexcept
Count the number of set bits in a value.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
const unsigned MAX_SUBTARGET_WORDS