Roms list properly handle sorting + use ircolib's log so i can stop worrying about re-definition of macros and shit
This commit is contained in:
Vendored
+36
-1
@@ -1,5 +1,11 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#ifdef USE_NEON
|
||||
#include <sse2neon.h>
|
||||
#else
|
||||
#include <emmintrin.h>
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
|
||||
namespace ircolib {
|
||||
using u8 = uint8_t;
|
||||
@@ -10,4 +16,33 @@ using s8 = int8_t;
|
||||
using s16 = int16_t;
|
||||
using s32 = int32_t;
|
||||
using s64 = int64_t;
|
||||
}
|
||||
|
||||
template <typename T, u32 bit>
|
||||
static constexpr bool is_bit_set(const T &val) {
|
||||
return val & (1 << bit);
|
||||
}
|
||||
|
||||
template <typename T, u32 bit>
|
||||
static constexpr void set_bit(T &val) {
|
||||
val |= 1 << bit;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool is_bit_set(const T &val, const u32 &bit) {
|
||||
return val & (1 << bit);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void set_bit(T &val, const u32 &bit) {
|
||||
val |= 1 << bit;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void clear_bit(T &val, const u32 &bit) {
|
||||
val &= ~(1 << bit);
|
||||
}
|
||||
} // namespace ircolib
|
||||
|
||||
constexpr ircolib::u32 operator""_kib(const unsigned long long v) { return v * 1024; }
|
||||
constexpr ircolib::u32 operator""_mib(const unsigned long long v) { return v * 1024 * 1024; }
|
||||
constexpr ircolib::u32 operator""_gib(const unsigned long long v) { return v * 1024 * 1024 * 1024; }
|
||||
|
||||
Reference in New Issue
Block a user