Misc: Simplify platform/compiler macros

This commit is contained in:
Stenzek 2023-12-22 20:41:59 +10:00 committed by Connor McLaughlin
parent dc859ca0a6
commit b844bb1268
14 changed files with 92 additions and 124 deletions

View File

@ -17,9 +17,9 @@
// make sure __POSIX__ is defined for all systems where we assume POSIX compliance // make sure __POSIX__ is defined for all systems where we assume POSIX compliance
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#ifndef __POSIX__ #ifndef __POSIX__
#define __POSIX__ 1 #define __POSIX__ 1
#endif #endif
#endif #endif
#include "Pcsx2Types.h" #include "Pcsx2Types.h"
@ -35,21 +35,16 @@
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// Dev / Debug conditionals - Consts for using if() statements instead of uglier #ifdef. // Dev / Debug conditionals - Consts for using if() statements instead of uglier #ifdef.
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// Note: Using if() optimizes nicely in Devel and Release builds, but will generate extra
// code overhead in debug builds (since debug neither inlines, nor optimizes out const-
// level conditionals). Normally not a concern, but if you stick if( IsDevbuild ) in
// some tight loops it will likely make debug builds unusably slow.
//
#ifdef PCSX2_DEVBUILD #ifdef PCSX2_DEVBUILD
static constexpr bool IsDevBuild = true; static constexpr bool IsDevBuild = true;
#else #else
static constexpr bool IsDevBuild = false; static constexpr bool IsDevBuild = false;
#endif #endif
#ifdef PCSX2_DEBUG #ifdef PCSX2_DEBUG
static constexpr bool IsDebugBuild = true; static constexpr bool IsDebugBuild = true;
#else #else
static constexpr bool IsDebugBuild = false; static constexpr bool IsDebugBuild = false;
#endif #endif
// Defines the memory page size for the target platform at compilation. All supported platforms // Defines the memory page size for the target platform at compilation. All supported platforms
@ -63,38 +58,40 @@ static constexpr unsigned int __pagemask = __pagesize - 1;
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
#ifdef _MSC_VER #ifdef _MSC_VER
#define __noinline __declspec(noinline) #define __noinline __declspec(noinline)
#define __noreturn __declspec(noreturn) #define __noreturn __declspec(noreturn)
#define RESTRICT __restrict
#define ASSUME(x) __assume(x)
#else #else
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// GCC / Intel Compilers Section // GCC / Clang Compilers Section
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
#define __assume(cond) do { if (!(cond)) __builtin_unreachable(); } while(0) // SysV ABI passes vector parameters through registers unconditionally.
#ifndef _WIN32
#define __vectorcall
#endif
// SysV ABI passes vector parameters through registers unconditionally. // Inlining note: GCC needs ((unused)) attributes defined on inlined functions to suppress
#ifndef _WIN32 // warnings when a static inlined function isn't used in the scope of a single file (which
#define __vectorcall // happens *by design* like all the friggen time >_<)
#endif
// Inlining note: GCC needs ((unused)) attributes defined on inlined functions to suppress #define __forceinline __attribute__((always_inline, unused))
// warnings when a static inlined function isn't used in the scope of a single file (which #define __noinline __attribute__((noinline))
// happens *by design* like all the friggen time >_<) #define __noreturn __attribute__((noreturn))
#define RESTRICT __restrict__
#define ASSUME(x) \
do \
{ \
if (!(x)) \
__builtin_unreachable(); \
} while (0)
#define _inline __inline__ __attribute__((unused))
#ifdef NDEBUG
#define __forceinline __attribute__((always_inline, unused))
#else
#define __forceinline __attribute__((unused))
#endif
#ifndef __noinline
#define __noinline __attribute__((noinline))
#endif
#ifndef __noreturn
#define __noreturn __attribute__((noreturn))
#endif
#endif #endif
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
@ -110,50 +107,18 @@ static constexpr unsigned int __pagemask = __pagesize - 1;
// //
#define __fi __forceinline #define __fi __forceinline
#ifdef PCSX2_DEVBUILD #ifdef PCSX2_DEVBUILD
#define __ri #define __ri
#else #else
#define __ri __fi #define __ri __fi
#endif
#ifndef RESTRICT
#if defined(_MSC_VER)
#define RESTRICT __restrict
#elif defined(__GNUC__)
#define RESTRICT __restrict__
#else
#define RESTRICT
#endif
#endif
// __assume, potentially enables optimization.
#ifdef _MSC_VER
#define ASSUME(x) __assume(x)
#else
#define ASSUME(x) \
do \
{ \
if (!(x)) \
__builtin_unreachable(); \
} while (0)
#endif #endif
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Safe deallocation macros -- checks pointer validity (non-null) when needed, and sets // Safe deallocation macros -- checks pointer validity (non-null) when needed, and sets
// pointer to null after deallocation. // pointer to null after deallocation.
#define safe_delete(ptr) \ #define safe_delete(ptr) (delete (ptr), (ptr) = nullptr)
((void)(delete (ptr)), (ptr) = NULL) #define safe_delete_array(ptr) (delete[] (ptr), (ptr) = nullptr)
#define safe_free(ptr) (std::free(ptr), (ptr) = nullptr)
#define safe_delete_array(ptr) \
((void)(delete[](ptr)), (ptr) = NULL)
// No checks for NULL.
#define safe_free(ptr) \
((void)(free(ptr), !!0), (ptr) = NULL)
//((void) (( ( (ptr) != NULL ) && (free( ptr ), !!0) ), (ptr) = NULL))
#define safe_fclose(ptr) \
((void)((((ptr) != NULL) && (fclose(ptr), !!0)), (ptr) = NULL))
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// ImplementEnumOperators (macro) // ImplementEnumOperators (macro)
@ -257,6 +222,6 @@ static constexpr s64 _4gb = _1gb * 4;
// Disable some spammy warnings which wx appeared to disable. // Disable some spammy warnings which wx appeared to disable.
// We probably should fix these at some point. // We probably should fix these at some point.
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(disable: 4244) // warning C4244: 'initializing': conversion from 'uptr' to 'uint', possible loss of data #pragma warning(disable : 4244) // warning C4244: 'initializing': conversion from 'uptr' to 'uint', possible loss of data
#pragma warning(disable: 4267) // warning C4267: 'initializing': conversion from 'size_t' to 'uint', possible loss of data #pragma warning(disable : 4267) // warning C4267: 'initializing': conversion from 'size_t' to 'uint', possible loss of data
#endif #endif

View File

@ -319,7 +319,7 @@ public:
case 1: WriteColumn32<1, alignment, mask>(dst, src, srcpitch); break; case 1: WriteColumn32<1, alignment, mask>(dst, src, srcpitch); break;
case 2: WriteColumn32<2, alignment, mask>(dst, src, srcpitch); break; case 2: WriteColumn32<2, alignment, mask>(dst, src, srcpitch); break;
case 3: WriteColumn32<3, alignment, mask>(dst, src, srcpitch); break; case 3: WriteColumn32<3, alignment, mask>(dst, src, srcpitch); break;
default: __assume(0); default: ASSUME(0);
} }
} }
@ -332,7 +332,7 @@ public:
case 1: WriteColumn16<1, alignment>(dst, src, srcpitch); break; case 1: WriteColumn16<1, alignment>(dst, src, srcpitch); break;
case 2: WriteColumn16<2, alignment>(dst, src, srcpitch); break; case 2: WriteColumn16<2, alignment>(dst, src, srcpitch); break;
case 3: WriteColumn16<3, alignment>(dst, src, srcpitch); break; case 3: WriteColumn16<3, alignment>(dst, src, srcpitch); break;
default: __assume(0); default: ASSUME(0);
} }
} }
@ -345,7 +345,7 @@ public:
case 1: WriteColumn8<1, alignment>(dst, src, srcpitch); break; case 1: WriteColumn8<1, alignment>(dst, src, srcpitch); break;
case 2: WriteColumn8<2, alignment>(dst, src, srcpitch); break; case 2: WriteColumn8<2, alignment>(dst, src, srcpitch); break;
case 3: WriteColumn8<3, alignment>(dst, src, srcpitch); break; case 3: WriteColumn8<3, alignment>(dst, src, srcpitch); break;
default: __assume(0); default: ASSUME(0);
} }
} }
@ -358,7 +358,7 @@ public:
case 1: WriteColumn4<1, alignment>(dst, src, srcpitch); break; case 1: WriteColumn4<1, alignment>(dst, src, srcpitch); break;
case 2: WriteColumn4<2, alignment>(dst, src, srcpitch); break; case 2: WriteColumn4<2, alignment>(dst, src, srcpitch); break;
case 3: WriteColumn4<3, alignment>(dst, src, srcpitch); break; case 3: WriteColumn4<3, alignment>(dst, src, srcpitch); break;
default: __assume(0); default: ASSUME(0);
} }
} }
@ -640,7 +640,7 @@ public:
case 1: ReadColumn32<1>(src, dst, dstpitch); break; case 1: ReadColumn32<1>(src, dst, dstpitch); break;
case 2: ReadColumn32<2>(src, dst, dstpitch); break; case 2: ReadColumn32<2>(src, dst, dstpitch); break;
case 3: ReadColumn32<3>(src, dst, dstpitch); break; case 3: ReadColumn32<3>(src, dst, dstpitch); break;
default: __assume(0); default: ASSUME(0);
} }
} }
@ -652,7 +652,7 @@ public:
case 1: ReadColumn16<1>(src, dst, dstpitch); break; case 1: ReadColumn16<1>(src, dst, dstpitch); break;
case 2: ReadColumn16<2>(src, dst, dstpitch); break; case 2: ReadColumn16<2>(src, dst, dstpitch); break;
case 3: ReadColumn16<3>(src, dst, dstpitch); break; case 3: ReadColumn16<3>(src, dst, dstpitch); break;
default: __assume(0); default: ASSUME(0);
} }
} }
@ -664,7 +664,7 @@ public:
case 1: ReadColumn8<1>(src, dst, dstpitch); break; case 1: ReadColumn8<1>(src, dst, dstpitch); break;
case 2: ReadColumn8<2>(src, dst, dstpitch); break; case 2: ReadColumn8<2>(src, dst, dstpitch); break;
case 3: ReadColumn8<3>(src, dst, dstpitch); break; case 3: ReadColumn8<3>(src, dst, dstpitch); break;
default: __assume(0); default: ASSUME(0);
} }
} }
@ -676,7 +676,7 @@ public:
case 1: ReadColumn4<1>(src, dst, dstpitch); break; case 1: ReadColumn4<1>(src, dst, dstpitch); break;
case 2: ReadColumn4<2>(src, dst, dstpitch); break; case 2: ReadColumn4<2>(src, dst, dstpitch); break;
case 3: ReadColumn4<3>(src, dst, dstpitch); break; case 3: ReadColumn4<3>(src, dst, dstpitch); break;
default: __assume(0); default: ASSUME(0);
} }
} }

View File

@ -202,7 +202,7 @@ bool GSClut::CanLoadCLUT(const GIFRegTEX0& TEX0, const bool update_CBP)
m_CBP[1] = TEX0.CBP; m_CBP[1] = TEX0.CBP;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
return true; return true;

View File

@ -235,7 +235,7 @@ void GSLocalMemoryFunctions::WriteImageColumn(GSLocalMemory& mem, int l, int r,
case PSMZ16: GSBlock::WriteColumn16<alignment>(y, mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break; case PSMZ16: GSBlock::WriteColumn16<alignment>(y, mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break;
case PSMZ16S: GSBlock::WriteColumn16<alignment>(y, mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break; case PSMZ16S: GSBlock::WriteColumn16<alignment>(y, mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break;
// TODO // TODO
default: __assume(0); default: ASSUME(0);
} }
} }
} }
@ -262,7 +262,7 @@ void GSLocalMemoryFunctions::WriteImageBlock(GSLocalMemory& mem, int l, int r, i
case PSMZ16: GSBlock::WriteBlock16<alignment>(mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break; case PSMZ16: GSBlock::WriteBlock16<alignment>(mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break;
case PSMZ16S: GSBlock::WriteBlock16<alignment>(mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break; case PSMZ16S: GSBlock::WriteBlock16<alignment>(mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break;
// TODO // TODO
default: __assume(0); default: ASSUME(0);
} }
} }
} }
@ -289,7 +289,7 @@ void GSLocalMemoryFunctions::WriteImageLeftRight(GSLocalMemory& mem, int l, int
case PSMZ16: mem.WritePixel16Z(x, y, *(u16*)&src[x * 2], bp, bw); break; case PSMZ16: mem.WritePixel16Z(x, y, *(u16*)&src[x * 2], bp, bw); break;
case PSMZ16S: mem.WritePixel16SZ(x, y, *(u16*)&src[x * 2], bp, bw); break; case PSMZ16S: mem.WritePixel16SZ(x, y, *(u16*)&src[x * 2], bp, bw); break;
// TODO // TODO
default: __assume(0); default: ASSUME(0);
} }
} }
} }
@ -328,7 +328,7 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int
case PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break; case PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break;
case PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break; case PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break;
// TODO // TODO
default: __assume(0); default: ASSUME(0);
} }
switch (psm) switch (psm)
@ -361,7 +361,7 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int
break; break;
// TODO // TODO
default: default:
__assume(0); ASSUME(0);
} }
} }
@ -421,7 +421,7 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int
case PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break; case PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break;
case PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break; case PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break;
// TODO // TODO
default: __assume(0); default: ASSUME(0);
} }
switch (psm) switch (psm)
@ -454,7 +454,7 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int
break; break;
// TODO // TODO
default: default:
__assume(0); ASSUME(0);
} }
} }
} }

View File

@ -1219,7 +1219,7 @@ struct alignas(32) GIFPath
case 16: case 16:
break; break;
default: default:
__assume(0); ASSUME(0);
} }
} }
} }

View File

@ -364,7 +364,7 @@ GSVideoMode GSState::GetVideoMode()
return GSVideoMode::Unknown; return GSVideoMode::Unknown;
} }
__assume(0); // unreachable ASSUME(0); // unreachable
} }
float GSState::GetTvRefreshRate() float GSState::GetTvRefreshRate()
@ -388,7 +388,7 @@ float GSState::GetTvRefreshRate()
return 0; return 0;
} }
__assume(0); // unreachable ASSUME(0); // unreachable
} }
const char* GSState::GetFlushReasonString(GSFlushReason reason) const char* GSState::GetFlushReasonString(GSFlushReason reason)
@ -1658,7 +1658,7 @@ void GSState::FlushPrim()
case GS_INVALID: case GS_INVALID:
break; break;
default: default:
__assume(0); ASSUME(0);
} }
pxAssert((int)unused < GSUtil::GetVertexCount(PRIM->PRIM)); pxAssert((int)unused < GSUtil::GetVertexCount(PRIM->PRIM));
@ -2427,7 +2427,7 @@ void GSState::Transfer(const u8* mem, u32 size)
break; break;
default: default:
__assume(0); ASSUME(0);
} }
path.nloop = 0; path.nloop = 0;
@ -2494,7 +2494,7 @@ void GSState::Transfer(const u8* mem, u32 size)
break; break;
} }
default: default:
__assume(0); ASSUME(0);
} }
} }
@ -3477,7 +3477,7 @@ __forceinline void GSState::VertexKick(u32 skip)
GrowVertexBuffer(); // in case too many vertices were skipped GrowVertexBuffer(); // in case too many vertices were skipped
break; break;
default: default:
__assume(0); ASSUME(0);
} }
return; return;
@ -3576,7 +3576,7 @@ __forceinline void GSState::VertexKick(u32 skip)
m_vertex.tail = head; m_vertex.tail = head;
return; return;
default: default:
__assume(0); ASSUME(0);
} }
// Update rectangle for the current draw. We can use the re-integer coordinates from min/max here. // Update rectangle for the current draw. We can use the re-integer coordinates from min/max here.
@ -3678,7 +3678,7 @@ GSState::TextureMinMaxResult GSState::GetTextureMinMax(GIFRegTEX0 TEX0, GIFRegCL
vr.z = (maxu | minu) + 1; vr.z = (maxu | minu) + 1;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
switch (wmt) switch (wmt)
@ -3696,7 +3696,7 @@ GSState::TextureMinMaxResult GSState::GetTextureMinMax(GIFRegTEX0 TEX0, GIFRegCL
vr.w = (maxv | minv) + 1; vr.w = (maxv | minv) + 1;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
// Software renderer fixes TEX0 so that TW/TH contain MAXU/MAXV. // Software renderer fixes TEX0 so that TW/TH contain MAXU/MAXV.
@ -3925,7 +3925,7 @@ void GSState::CalcAlphaMinMax(const int tex_alpha_min, const int tex_alpha_max)
m_mem.m_clut.GetAlphaMinMax32(a.y, a.w); m_mem.m_clut.GetAlphaMinMax32(a.y, a.w);
break; break;
default: default:
__assume(0); ASSUME(0);
} }
switch (context->TEX0.TFX) switch (context->TEX0.TFX)
@ -3955,7 +3955,7 @@ void GSState::CalcAlphaMinMax(const int tex_alpha_min, const int tex_alpha_max)
a.z = a.w; a.z = a.w;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
} }
min = a.x; min = a.x;
@ -3995,7 +3995,7 @@ bool GSState::TryAlphaTest(u32& fm, u32& zm)
return true; return true;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
bool pass = true; bool pass = true;
@ -4069,7 +4069,7 @@ bool GSState::TryAlphaTest(u32& fm, u32& zm)
return false; return false;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
} }
@ -4091,7 +4091,7 @@ bool GSState::TryAlphaTest(u32& fm, u32& zm)
zm = 0xffffffff; zm = 0xffffffff;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
} }

View File

@ -553,7 +553,7 @@ public:
case 1: return yyyy(v).zxzw(*this); case 1: return yyyy(v).zxzw(*this);
case 2: return yyzz(v).zxzw(*this); case 2: return yyzz(v).zxzw(*this);
case 3: return yyww(v).zxzw(*this); case 3: return yyww(v).zxzw(*this);
default: __assume(0); default: ASSUME(0);
} }
break; break;
case 1: case 1:
@ -563,7 +563,7 @@ public:
case 1: return xxyy(v).xzzw(*this); case 1: return xxyy(v).xzzw(*this);
case 2: return xxzz(v).xzzw(*this); case 2: return xxzz(v).xzzw(*this);
case 3: return xxww(v).xzzw(*this); case 3: return xxww(v).xzzw(*this);
default: __assume(0); default: ASSUME(0);
} }
break; break;
case 2: case 2:
@ -573,7 +573,7 @@ public:
case 1: return xyzx(wwyy(v)); case 1: return xyzx(wwyy(v));
case 2: return xyzx(wwzz(v)); case 2: return xyzx(wwzz(v));
case 3: return xyzx(wwww(v)); case 3: return xyzx(wwww(v));
default: __assume(0); default: ASSUME(0);
} }
break; break;
case 3: case 3:
@ -583,11 +583,11 @@ public:
case 1: return xyxz(zzyy(v)); case 1: return xyxz(zzyy(v));
case 2: return xyxz(zzzz(v)); case 2: return xyxz(zzzz(v));
case 3: return xyxz(zzww(v)); case 3: return xyxz(zzww(v));
default: __assume(0); default: ASSUME(0);
} }
break; break;
default: default:
__assume(0); ASSUME(0);
} }
#endif #endif

View File

@ -512,7 +512,7 @@ public:
case 1: return yyyy(v).zxzw(*this); case 1: return yyyy(v).zxzw(*this);
case 2: return yyzz(v).zxzw(*this); case 2: return yyzz(v).zxzw(*this);
case 3: return yyww(v).zxzw(*this); case 3: return yyww(v).zxzw(*this);
default: __assume(0); default: ASSUME(0);
} }
break; break;
case 1: case 1:
@ -522,7 +522,7 @@ public:
case 1: return xxyy(v).xzzw(*this); case 1: return xxyy(v).xzzw(*this);
case 2: return xxzz(v).xzzw(*this); case 2: return xxzz(v).xzzw(*this);
case 3: return xxww(v).xzzw(*this); case 3: return xxww(v).xzzw(*this);
default: __assume(0); default: ASSUME(0);
} }
break; break;
case 2: case 2:
@ -532,7 +532,7 @@ public:
case 1: return xyzx(wwyy(v)); case 1: return xyzx(wwyy(v));
case 2: return xyzx(wwzz(v)); case 2: return xyzx(wwzz(v));
case 3: return xyzx(wwww(v)); case 3: return xyzx(wwww(v));
default: __assume(0); default: ASSUME(0);
} }
break; break;
case 3: case 3:
@ -542,11 +542,11 @@ public:
case 1: return xyxz(zzyy(v)); case 1: return xyxz(zzyy(v));
case 2: return xyxz(zzzz(v)); case 2: return xyxz(zzzz(v));
case 3: return xyxz(zzww(v)); case 3: return xyxz(zzww(v));
default: __assume(0); default: ASSUME(0);
} }
break; break;
default: default:
__assume(0); ASSUME(0);
} }
return *this; return *this;

View File

@ -3107,7 +3107,7 @@ void GSRendererHW::SetupIA(float target_scale, float sx, float sy)
break; break;
default: default:
__assume(0); ASSUME(0);
} }
m_conf.verts = m_vertex.buff; m_conf.verts = m_vertex.buff;
@ -5376,7 +5376,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
case AFAIL_FB_ONLY: z = false; break; // rgba case AFAIL_FB_ONLY: z = false; break; // rgba
case AFAIL_ZB_ONLY: r = g = b = a = false; break; // z case AFAIL_ZB_ONLY: r = g = b = a = false; break; // z
case AFAIL_RGB_ONLY: z = a = false; break; // rgb case AFAIL_RGB_ONLY: z = a = false; break; // rgb
default: __assume(0); default: ASSUME(0);
} }
// Depth test should be disabled when depth writes are masked and similarly, Alpha test must be disabled // Depth test should be disabled when depth writes are masked and similarly, Alpha test must be disabled

View File

@ -365,7 +365,7 @@ bool GSRendererHWFunctions::SwPrimRender(GSRendererHW& hw, bool invalidate_tc, b
gd.t.mask.U32[0] = 0xffffffff; gd.t.mask.U32[0] = 0xffffffff;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
switch (context->CLAMP.WMT) switch (context->CLAMP.WMT)
@ -393,7 +393,7 @@ bool GSRendererHWFunctions::SwPrimRender(GSRendererHW& hw, bool invalidate_tc, b
gd.t.mask.U32[2] = 0xffffffff; gd.t.mask.U32[2] = 0xffffffff;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
gd.t.min = gd.t.min.xxxxlh(); gd.t.min = gd.t.min.xxxxlh();

View File

@ -395,7 +395,7 @@ __ri static bool TestAlpha(T& test, T& fm, T& zm, const T& ga, const GSScanlineG
break; break;
default: default:
__assume(0); ASSUME(0);
} }
switch (sel.afail) switch (sel.afail)
@ -420,7 +420,7 @@ __ri static bool TestAlpha(T& test, T& fm, T& zm, const T& ga, const GSScanlineG
break; break;
default: default:
__assume(0); ASSUME(0);
} }
return true; return true;

View File

@ -246,7 +246,7 @@ void GSRasterizer::Draw(GSRasterizerData& data)
break; break;
default: default:
__assume(0); ASSUME(0);
} }
#if _M_SSE >= 0x501 #if _M_SSE >= 0x501

View File

@ -1241,7 +1241,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
gd.t.mask.U32[0] = 0xffffffff; gd.t.mask.U32[0] = 0xffffffff;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
switch (context->CLAMP.WMT) switch (context->CLAMP.WMT)
@ -1270,7 +1270,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
gd.t.mask.U32[2] = 0xffffffff; gd.t.mask.U32[2] = 0xffffffff;
break; break;
default: default:
__assume(0); ASSUME(0);
} }
gd.t.min = gd.t.min.xxxxlh(); gd.t.min = gd.t.min.xxxxlh();

View File

@ -23,6 +23,9 @@
#ifdef PCSX2_DEVBUILD #ifdef PCSX2_DEVBUILD
#define safe_fclose(ptr) \
((void)((((ptr) != nullptr) && (std::fclose(ptr), !!0)), (ptr) = nullptr))
static FILE* DMA4LogFile = nullptr; static FILE* DMA4LogFile = nullptr;
static FILE* DMA7LogFile = nullptr; static FILE* DMA7LogFile = nullptr;
static FILE* ADMA4LogFile = nullptr; static FILE* ADMA4LogFile = nullptr;