mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2025-12-27 01:34:55 +01:00
bit_util: Implement MostSignificantBit
This commit is contained in:
parent
95ad0d0a66
commit
b00fe23b91
1 changed files with 5 additions and 0 deletions
|
|
@ -151,6 +151,11 @@ inline size_t LowestSetBit(T value) {
|
|||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool MostSignificantBit(T value) {
|
||||
return Bit<BitSize<T>() - 1, T>(value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T Replicate(T value, size_t element_size) {
|
||||
ASSERT_MSG(BitSize<T>() % element_size == 0, "bitsize of T not divisible by element_size");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue