diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-28 23:56:19 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-28 23:56:19 +0800 |
| commit | 7ee5d1913c7cfd0261f86b0ff7be6968b8c07d84 (patch) | |
| tree | 446dafb95e2f792fee922602b74709c5b9e0777c /backend/utils/TableGen/Common/CodeGenInstruction.cpp | |
| parent | f0cfb240d80cb9f4444fb996350c1f88bc69a142 (diff) | |
| download | rcc-project-7ee5d1913c7cfd0261f86b0ff7be6968b8c07d84.tar.gz rcc-project-7ee5d1913c7cfd0261f86b0ff7be6968b8c07d84.tar.xz | |
[Support] Use standard power-of-two checks
Diffstat (limited to 'backend/utils/TableGen/Common/CodeGenInstruction.cpp')
| -rw-r--r-- | backend/utils/TableGen/Common/CodeGenInstruction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/utils/TableGen/Common/CodeGenInstruction.cpp b/backend/utils/TableGen/Common/CodeGenInstruction.cpp index a34f5ab..e7f5ddc 100644 --- a/backend/utils/TableGen/Common/CodeGenInstruction.cpp +++ b/backend/utils/TableGen/Common/CodeGenInstruction.cpp @@ -4,6 +4,7 @@ #include <algorithm> #include <array> +#include <bit> #include <cstdint> #include <limits> #include <ranges> @@ -218,7 +219,7 @@ pipelineStageEnumerator(std::string_view Value) noexcept { const bool IsUnsigned = Predicate.Kind == "unsigned"; if (Predicate.ID == 0 || !isIdentifier(Predicate.Symbol) || Predicate.Name.empty() || (!IsSigned && !IsUnsigned) || Predicate.Bits == 0 || Predicate.Bits > 63 || - !isPowerOfTwo(Predicate.Alignment) || !IDs.insert(Predicate.ID).second || + !std::has_single_bit(Predicate.Alignment) || !IDs.insert(Predicate.ID).second || !Symbols.insert(Predicate.Symbol).second || !Names.insert(Predicate.Name).second) { fail(Predicate.Range, "immediate predicates require nonzero unique IDs, symbols, names, a signed or " |
