mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #13436 from JoshuaVandaele/clang-format-19
Update clang-format to version 19
This commit is contained in:
@ -429,7 +429,10 @@ extern const CaseInsensitiveDict<ParseInfo, '.', '_'> mnemonic_tokens = {
|
||||
|
||||
#define PSEUDO(mnemonic, base, variant_bits, alg) \
|
||||
{ \
|
||||
mnemonic, { static_cast<size_t>(base) * VARIANT_PERMUTATIONS + (variant_bits), alg } \
|
||||
mnemonic, \
|
||||
{ \
|
||||
static_cast<size_t>(base) * VARIANT_PERMUTATIONS + (variant_bits), alg \
|
||||
} \
|
||||
}
|
||||
#define PLAIN_PSEUDO(mnemonic, base, alg) PSEUDO(mnemonic, base, PLAIN_MNEMONIC, alg)
|
||||
#define RC_PSEUDO(mnemonic, base, alg) \
|
||||
@ -673,7 +676,7 @@ extern const CaseInsensitiveDict<ParseInfo, '.', '_', '+', '-'> extended_mnemoni
|
||||
EMIT_MNEMONIC_ENTRY(opcode_val, ((extra_bits) | InsertVal(0b11, 30, 31)), __VA_ARGS__)
|
||||
|
||||
// Defines all basic mnemonics that Broadway/Gekko supports
|
||||
extern const std::array<MnemonicDesc, NUM_MNEMONICS* VARIANT_PERMUTATIONS> mnemonics = {
|
||||
extern const std::array<MnemonicDesc, NUM_MNEMONICS * VARIANT_PERMUTATIONS> mnemonics = {
|
||||
// A-2
|
||||
OERC_MNEMONIC(31, InsertVal(266, 22, 30), OpDesc_D, OpDesc_A, OpDesc_B), // add
|
||||
OERC_MNEMONIC(31, InsertVal(10, 22, 30), OpDesc_D, OpDesc_A, OpDesc_B), // addc
|
||||
@ -1048,7 +1051,10 @@ void FillMfsprBatAndBitswap(OperandList& operands)
|
||||
} // namespace
|
||||
|
||||
#define PSEUDO(base, variant_bits, cb) \
|
||||
ExtendedMnemonicDesc { static_cast<size_t>(base) * VARIANT_PERMUTATIONS + variant_bits, cb }
|
||||
ExtendedMnemonicDesc \
|
||||
{ \
|
||||
static_cast<size_t>(base) * VARIANT_PERMUTATIONS + variant_bits, cb \
|
||||
}
|
||||
#define PLAIN_PSEUDO(base, cb) \
|
||||
PSEUDO(base, PLAIN_MNEMONIC, cb), INVALID_EXT_MNEMONIC, INVALID_EXT_MNEMONIC, INVALID_EXT_MNEMONIC
|
||||
#define RC_PSEUDO(base, cb) \
|
||||
@ -1064,7 +1070,7 @@ void FillMfsprBatAndBitswap(OperandList& operands)
|
||||
PSEUDO(base, PLAIN_MNEMONIC, cb), PSEUDO(base, LINK_BIT, cb), \
|
||||
PSEUDO(base, ABSOLUTE_ADDRESS_BIT, cb), PSEUDO(base, (LINK_BIT | ABSOLUTE_ADDRESS_BIT), cb)
|
||||
|
||||
extern const std::array<ExtendedMnemonicDesc, NUM_EXT_MNEMONICS* VARIANT_PERMUTATIONS>
|
||||
extern const std::array<ExtendedMnemonicDesc, NUM_EXT_MNEMONICS * VARIANT_PERMUTATIONS>
|
||||
extended_mnemonics = {
|
||||
// E.2.1
|
||||
PLAIN_PSEUDO(GekkoMnemonic::Addi, NegateSIMM), // subi
|
||||
|
@ -26,7 +26,7 @@ static u32 Decode5A3(u16 val)
|
||||
{
|
||||
r = s_lut5to8[(val >> 10) & 0x1f];
|
||||
g = s_lut5to8[(val >> 5) & 0x1f];
|
||||
b = s_lut5to8[(val)&0x1f];
|
||||
b = s_lut5to8[(val) & 0x1f];
|
||||
a = 0xFF;
|
||||
}
|
||||
else
|
||||
@ -34,7 +34,7 @@ static u32 Decode5A3(u16 val)
|
||||
a = s_lut3to8[(val >> 12) & 0x7];
|
||||
r = (s_lut4to8[(val >> 8) & 0xf] * a + (bg_color & 0xFF) * (255 - a)) / 255;
|
||||
g = (s_lut4to8[(val >> 4) & 0xf] * a + ((bg_color >> 8) & 0xFF) * (255 - a)) / 255;
|
||||
b = (s_lut4to8[(val)&0xf] * a + ((bg_color >> 16) & 0xFF) * (255 - a)) / 255;
|
||||
b = (s_lut4to8[(val) & 0xf] * a + ((bg_color >> 16) & 0xFF) * (255 - a)) / 255;
|
||||
a = 0xFF;
|
||||
}
|
||||
return (a << 24) | (r << 16) | (g << 8) | b;
|
||||
|
@ -155,6 +155,6 @@ int __cdecl EnableCompatPatches()
|
||||
// referencing it doesn't require ugly decorated names.
|
||||
// Use /include:enableCompatPatches linker flag to enable this.
|
||||
extern "C" {
|
||||
__declspec(allocate(".CRT$XCZ")) decltype(&EnableCompatPatches)
|
||||
enableCompatPatches = EnableCompatPatches;
|
||||
__declspec(allocate(".CRT$XCZ")) decltype(&EnableCompatPatches) enableCompatPatches =
|
||||
EnableCompatPatches;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace Config
|
||||
// Setting a key to an object of this type will delete the key.
|
||||
struct DefaultState
|
||||
{
|
||||
friend constexpr bool operator==(DefaultState, DefaultState) { return true; };
|
||||
friend constexpr bool operator==(DefaultState, DefaultState) { return true; }
|
||||
};
|
||||
|
||||
namespace detail
|
||||
|
@ -11,16 +11,16 @@ namespace Common
|
||||
struct ContainsFn
|
||||
{
|
||||
template <std::input_iterator I, std::sentinel_for<I> S, class T, class Proj = std::identity>
|
||||
requires std::indirect_binary_predicate < std::ranges::equal_to, std::projected<I, Proj>,
|
||||
const T* > constexpr bool operator()(I first, S last, const T& value, Proj proj = {}) const
|
||||
requires std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>, const T*>
|
||||
constexpr bool operator()(I first, S last, const T& value, Proj proj = {}) const
|
||||
{
|
||||
return std::ranges::find(std::move(first), last, value, std::move(proj)) != last;
|
||||
}
|
||||
|
||||
template <std::ranges::input_range R, class T, class Proj = std::identity>
|
||||
requires std::indirect_binary_predicate < std::ranges::equal_to,
|
||||
std::projected<std::ranges::iterator_t<R>, Proj>,
|
||||
const T* > constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const
|
||||
requires std::indirect_binary_predicate<
|
||||
std::ranges::equal_to, std::projected<std::ranges::iterator_t<R>, Proj>, const T*>
|
||||
constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const
|
||||
{
|
||||
return (*this)(std::ranges::begin(r), std::ranges::end(r), value, std::move(proj));
|
||||
}
|
||||
|
@ -996,41 +996,23 @@ PFNDOLDISPATCHCOMPUTEPROC dolDispatchCompute;
|
||||
PFNDOLDISPATCHCOMPUTEINDIRECTPROC dolDispatchComputeIndirect;
|
||||
|
||||
// Creates a GLFunc object that requires a feature
|
||||
#define GLFUNC_REQUIRES(x, y) \
|
||||
{ \
|
||||
(void**)&x, #x, y \
|
||||
}
|
||||
#define GLFUNC_REQUIRES(x, y) {(void**)&x, #x, y}
|
||||
// Creates a GLFunc object with a different function suffix
|
||||
// For when we want to use the same function pointer, but different function name
|
||||
#define GLFUNC_SUFFIX(x, y, z) \
|
||||
{ \
|
||||
(void**)&x, #x #y, z \
|
||||
}
|
||||
#define GLFUNC_SUFFIX(x, y, z) {(void**)&x, #x #y, z}
|
||||
// Creates a GLFunc object that should always be able to get grabbed
|
||||
// Used for Desktop OpenGL functions that should /always/ be provided.
|
||||
// aka GL 1.1/1.2/1.3/1.4
|
||||
#define GLFUNC_ALWAYS_REQUIRED(x) \
|
||||
{ \
|
||||
(void**)&x, #x, "VERSION_GL" \
|
||||
}
|
||||
#define GLFUNC_ALWAYS_REQUIRED(x) {(void**)&x, #x, "VERSION_GL"}
|
||||
// Creates a GLFunc object that should be able to get grabbed
|
||||
// on both GL and ES
|
||||
#define GL_ES_FUNC_ALWAYS_REQUIRED(x) \
|
||||
{ \
|
||||
(void**)&x, #x, "VERSION_GL |VERSION_GLES_2" \
|
||||
}
|
||||
#define GL_ES_FUNC_ALWAYS_REQUIRED(x) {(void**)&x, #x, "VERSION_GL |VERSION_GLES_2"}
|
||||
// Creates a GLFunc object that should be able to get grabbed
|
||||
// on both GL and ES 3.0
|
||||
#define GL_ES3_FUNC_ALWAYS_REQUIRED(x) \
|
||||
{ \
|
||||
(void**)&x, #x, "VERSION_GL |VERSION_GLES_3" \
|
||||
}
|
||||
#define GL_ES3_FUNC_ALWAYS_REQUIRED(x) {(void**)&x, #x, "VERSION_GL |VERSION_GLES_3"}
|
||||
// Creates a GLFunc object that should be able to get grabbed
|
||||
// on both GL and ES 3.2
|
||||
#define GL_ES32_FUNC_ALWAYS_REQUIRED(x) \
|
||||
{ \
|
||||
(void**)&x, #x, "VERSION_GL |VERSION_GLES_3_2" \
|
||||
}
|
||||
#define GL_ES32_FUNC_ALWAYS_REQUIRED(x) {(void**)&x, #x, "VERSION_GL |VERSION_GLES_3_2"}
|
||||
|
||||
struct GLFunc
|
||||
{
|
||||
|
@ -73,17 +73,17 @@ namespace Common
|
||||
#define PPCLSH 21
|
||||
#define PPCIDX2SH 1
|
||||
|
||||
#define PPCGETIDX(x) (((x)&PPCIDXMASK) >> PPCIDXSH)
|
||||
#define PPCGETD(x) (((x)&PPCDMASK) >> PPCDSH)
|
||||
#define PPCGETA(x) (((x)&PPCAMASK) >> PPCASH)
|
||||
#define PPCGETB(x) (((x)&PPCBMASK) >> PPCBSH)
|
||||
#define PPCGETC(x) (((x)&PPCCMASK) >> PPCCSH)
|
||||
#define PPCGETM(x) (((x)&PPCMMASK) >> PPCMSH)
|
||||
#define PPCGETCRD(x) (((x)&PPCCRDMASK) >> PPCCRDSH)
|
||||
#define PPCGETCRA(x) (((x)&PPCCRAMASK) >> PPCCRASH)
|
||||
#define PPCGETL(x) (((x)&PPCLMASK) >> PPCLSH)
|
||||
#define PPCGETIDX2(x) (((x)&PPCIDX2MASK) >> PPCIDX2SH)
|
||||
#define PPCGETSTRM(x) (((x)&PPCSTRM) >> PPCDSH)
|
||||
#define PPCGETIDX(x) (((x) & PPCIDXMASK) >> PPCIDXSH)
|
||||
#define PPCGETD(x) (((x) & PPCDMASK) >> PPCDSH)
|
||||
#define PPCGETA(x) (((x) & PPCAMASK) >> PPCASH)
|
||||
#define PPCGETB(x) (((x) & PPCBMASK) >> PPCBSH)
|
||||
#define PPCGETC(x) (((x) & PPCCMASK) >> PPCCSH)
|
||||
#define PPCGETM(x) (((x) & PPCMMASK) >> PPCMSH)
|
||||
#define PPCGETCRD(x) (((x) & PPCCRDMASK) >> PPCCRDSH)
|
||||
#define PPCGETCRA(x) (((x) & PPCCRAMASK) >> PPCCRASH)
|
||||
#define PPCGETL(x) (((x) & PPCLMASK) >> PPCLSH)
|
||||
#define PPCGETIDX2(x) (((x) & PPCIDX2MASK) >> PPCIDX2SH)
|
||||
#define PPCGETSTRM(x) (((x) & PPCSTRM) >> PPCDSH)
|
||||
|
||||
constexpr std::array<const char*, 32> trap_condition{
|
||||
nullptr, "lgt", "llt", nullptr, "eq", "lge", "lle", nullptr,
|
||||
|
@ -73,9 +73,8 @@ void TruncateToCString(std::string* s);
|
||||
bool TryParse(const std::string& str, bool* output);
|
||||
|
||||
template <typename T>
|
||||
requires(std::is_integral_v<T> ||
|
||||
(std::is_enum_v<T> && !detail::IsBooleanEnum<T>())) bool TryParse(const std::string& str,
|
||||
T* output, int base = 0)
|
||||
requires(std::is_integral_v<T> || (std::is_enum_v<T> && !detail::IsBooleanEnum<T>()))
|
||||
bool TryParse(const std::string& str, T* output, int base = 0)
|
||||
{
|
||||
char* end_ptr = nullptr;
|
||||
|
||||
@ -113,7 +112,8 @@ requires(std::is_integral_v<T> ||
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
requires(detail::IsBooleanEnum<T>()) bool TryParse(const std::string& str, T* output)
|
||||
requires(detail::IsBooleanEnum<T>())
|
||||
bool TryParse(const std::string& str, T* output)
|
||||
{
|
||||
bool value;
|
||||
if (!TryParse(str, &value))
|
||||
|
Reference in New Issue
Block a user