DiscIO: Add workaround for MSVC ARM64 ICE

This commit is contained in:
Shawn Hoffman 2021-06-29 10:24:09 +02:00 committed by JosJuice
parent 3b3fb9d4c3
commit 30f9f31a69
1 changed files with 14 additions and 16 deletions

View File

@ -70,7 +70,7 @@ private:
using SHA1 = std::array<u8, 20>;
using WiiKey = std::array<u8, 16>;
// See docs/WIA.md for details about the format
// See docs/WiaAndRvz.md for details about the format
#pragma pack(push, 1)
struct WIAHeader1
@ -241,25 +241,23 @@ private:
struct ReuseID
{
bool operator==(const ReuseID& other) const
{
return std::tie(partition_key, data_size, encrypted, value) ==
std::tie(other.partition_key, other.data_size, other.encrypted, other.value);
}
bool operator<(const ReuseID& other) const
{
return std::tie(partition_key, data_size, encrypted, value) <
std::tie(other.partition_key, other.data_size, other.encrypted, other.value);
}
bool operator>(const ReuseID& other) const
{
return std::tie(partition_key, data_size, encrypted, value) >
std::tie(other.partition_key, other.data_size, other.encrypted, other.value);
}
// This is a workaround for an ICE in Visual Studio 16.10.0 when making an ARM64 Release build.
// Once the ICE has been fixed upstream, we can move partition_key inside the tie.
#define COMPARE_TIED(op) \
(partition_key op other.partition_key) && \
std::tie(data_size, encrypted, value) \
op std::tie(other.data_size, other.encrypted, other.value)
bool operator==(const ReuseID& other) const { return COMPARE_TIED(==); }
bool operator<(const ReuseID& other) const { return COMPARE_TIED(<); }
bool operator>(const ReuseID& other) const { return COMPARE_TIED(>); }
bool operator!=(const ReuseID& other) const { return !operator==(other); }
bool operator>=(const ReuseID& other) const { return !operator<(other); }
bool operator<=(const ReuseID& other) const { return !operator>(other); }
#undef COMPARE_TIED
const WiiKey* partition_key;
u64 data_size;
bool encrypted;