mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 13:48:56 +00:00
JitArm64: Turn IsImmLogical into a constexpr constructor
This commit is contained in:
parent
ab024b218e
commit
10861ed8ce
3 changed files with 234 additions and 224 deletions
|
@ -413,4 +413,13 @@ constexpr int CountLeadingZeros(uint32_t value)
|
|||
|
||||
#undef CONSTEXPR_FROM_INTRINSIC
|
||||
|
||||
template <typename T>
|
||||
constexpr T LargestPowerOf2Divisor(T value)
|
||||
{
|
||||
static_assert(std::is_unsigned<T>(),
|
||||
"LargestPowerOf2Divisor only makes sense for unsigned types.");
|
||||
|
||||
return value & -static_cast<std::make_signed_t<T>>(value);
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue