From 1386caba9f13aadf551463076846e8a7a6657d74 Mon Sep 17 00:00:00 2001 From: hashlag Date: Mon, 17 Aug 2026 03:13:55 +0300 Subject: [PATCH] Branchless: Rename Msb() --> MsbMask(). --- Chaos/Service/Branchless.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chaos/Service/Branchless.hpp b/Chaos/Service/Branchless.hpp index 5e8336f..3c3dff4 100644 --- a/Chaos/Service/Branchless.hpp +++ b/Chaos/Service/Branchless.hpp @@ -11,7 +11,7 @@ namespace Chaos::Service struct Branchless { template - static constexpr OutUInt Msb(InUInt in) noexcept + static constexpr OutUInt MsbMask(InUInt in) noexcept { static_assert(std::is_unsigned_v && std::is_unsigned_v); @@ -30,7 +30,7 @@ struct Branchless const uint64_t lhsEx = lhs; const uint64_t rhsEx = rhs; - return Msb(lhsEx ^ ((lhsEx ^ rhsEx) | ((lhsEx - rhsEx) ^ lhsEx))); + return MsbMask(lhsEx ^ ((lhsEx ^ rhsEx) | ((lhsEx - rhsEx) ^ lhsEx))); } template @@ -42,7 +42,7 @@ struct Branchless const uint64_t inEx = in; - return Msb(~inEx & (inEx - 1U)); + return MsbMask(~inEx & (inEx - 1U)); } template