mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-25 11:48:47 +00:00
A64: Implement DUP (general)
This commit is contained in:
@@ -98,6 +98,17 @@ inline int HighestSetBit(T value) {
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline size_t LowestSetBit(T value) {
|
||||
auto x = static_cast<std::make_unsigned_t<T>>(value);
|
||||
size_t result = 0;
|
||||
while ((x & 1) == 0) {
|
||||
x >>= 1;
|
||||
result++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T Ones(size_t count) {
|
||||
ASSERT_MSG(count <= BitSize<T>(), "count larger than bitsize of T");
|
||||
|
||||
Reference in New Issue
Block a user