From 7ee5d1913c7cfd0261f86b0ff7be6968b8c07d84 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Fri, 28 Aug 2026 23:56:19 +0800 Subject: [Support] Use standard power-of-two checks --- backend/utils/TableGen/Common/CodeGenInstruction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend/utils/TableGen/Common/CodeGenInstruction.cpp') 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 #include +#include #include #include #include @@ -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 " -- cgit v1.2.3