From 31e9206fc0a8284fb799248f72364c863375b715 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 22 Dec 2023 19:41:44 +1000 Subject: [PATCH] Common: Purge unused macros --- common/AlignedMalloc.cpp | 4 +- common/Pcsx2Defs.h | 47 ++++--------------- .../SW/GSDrawScanlineCodeGenerator.h | 20 ++------ pcsx2/GS/Renderers/SW/GSNewCodeGenerator.h | 8 +++- .../Renderers/SW/GSSetupPrimCodeGenerator.h | 10 ++-- 5 files changed, 27 insertions(+), 62 deletions(-) diff --git a/common/AlignedMalloc.cpp b/common/AlignedMalloc.cpp index 5db3b40246..f4811a3ef7 100644 --- a/common/AlignedMalloc.cpp +++ b/common/AlignedMalloc.cpp @@ -20,7 +20,9 @@ #include "common/AlignedMalloc.h" #include "common/Assertions.h" -#include + +#include +#include void* _aligned_malloc(size_t size, size_t align) { diff --git a/common/Pcsx2Defs.h b/common/Pcsx2Defs.h index 0961dc13a3..75e58e0b21 100644 --- a/common/Pcsx2Defs.h +++ b/common/Pcsx2Defs.h @@ -41,35 +41,15 @@ // some tight loops it will likely make debug builds unusably slow. // #ifdef PCSX2_DEVBUILD - static const bool IsDevBuild = true; + static constexpr bool IsDevBuild = true; #else - static const bool IsDevBuild = false; + static constexpr bool IsDevBuild = false; #endif #ifdef PCSX2_DEBUG - static const bool IsDebugBuild = true; + static constexpr bool IsDebugBuild = true; #else - static const bool IsDebugBuild = false; -#endif - -#ifdef PCSX2_DEBUG - #define pxDebugCode(code) code -#else - #define pxDebugCode(code) -#endif - -#ifdef PCSX2_DEVBUILD - #define pxDevelCode(code) code -#else - #define pxDevelCode(code) -#endif - -#if defined(PCSX2_DEBUG) || defined(PCSX2_DEVBUILD) - #define pxReleaseCode(code) - #define pxNonReleaseCode(code) code -#else - #define pxReleaseCode(code) code - #define pxNonReleaseCode(code) + static constexpr bool IsDebugBuild = false; #endif // Defines the memory page size for the target platform at compilation. All supported platforms @@ -134,17 +114,12 @@ static constexpr unsigned int __pagemask = __pagesize - 1; // from Devel builds is likely useful; but which should be inlined in an optimized Release // environment. // -#ifdef PCSX2_DEVBUILD - #define __releaseinline -#else - #define __releaseinline __forceinline -#endif - -#define __ri __releaseinline #define __fi __forceinline - -// Makes sure that if anyone includes xbyak, it doesn't do anything bad -#define XBYAK_ENABLE_OMITTED_OPERAND +#ifdef PCSX2_DEVBUILD + #define __ri +#else + #define __ri __fi +#endif #if defined(__x86_64__) && !defined(_M_AMD64) #define _M_AMD64 @@ -164,10 +139,6 @@ static constexpr unsigned int __pagemask = __pagesize - 1; #define __has_attribute(x) 0 #endif -#ifndef __has_builtin - #define __has_builtin(x) 0 -#endif - #ifdef __cpp_constinit #define CONSTINIT constinit #elif __has_attribute(require_constant_initialization) diff --git a/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.h b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.h index 21b6a2f4a4..cab74ecd70 100644 --- a/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.h +++ b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.h @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2021 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -15,27 +15,17 @@ #pragma once -#include "GSScanlineEnvironment.h" -#include "GS/Renderers/Common/GSFunctionMap.h" +#include "GS/Renderers/SW/GSScanlineEnvironment.h" +#include "GS/Renderers/SW/GSNewCodeGenerator.h" #include "GS/GSUtil.h" #include "GS/MultiISA.h" -#ifdef _WIN32 -#include "common/RedtapeWindows.h" -#endif -#include - -#if defined(_M_AMD64) || defined(_WIN64) -#define RegLong Xbyak::Reg64 -#else -#define RegLong Xbyak::Reg32 -#endif - MULTI_ISA_UNSHARED_START class GSDrawScanlineCodeGenerator : public Xbyak::CodeGenerator { - void operator=(const GSDrawScanlineCodeGenerator&); + GSDrawScanlineCodeGenerator(const GSDrawScanlineCodeGenerator&) = delete; + void operator=(const GSDrawScanlineCodeGenerator&) = delete; GSScanlineSelector m_sel; diff --git a/pcsx2/GS/Renderers/SW/GSNewCodeGenerator.h b/pcsx2/GS/Renderers/SW/GSNewCodeGenerator.h index 2404d27936..cbc29ffd20 100644 --- a/pcsx2/GS/Renderers/SW/GSNewCodeGenerator.h +++ b/pcsx2/GS/Renderers/SW/GSNewCodeGenerator.h @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2021 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -15,7 +15,13 @@ #pragma once +// Xbyak pulls in windows.h, and breaks everything. +#ifdef _WIN32 +#include "common/RedtapeWindows.h" +#endif + #define XBYAK_NO_OP_NAMES +#define XBYAK_ENABLE_OMITTED_OPERAND #include "xbyak/xbyak.h" #include "xbyak/xbyak_util.h" diff --git a/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.h b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.h index 51041a2751..0f4f0f5d1a 100644 --- a/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.h +++ b/pcsx2/GS/Renderers/SW/GSSetupPrimCodeGenerator.h @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2021 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -15,15 +15,11 @@ #pragma once -#include "GSScanlineEnvironment.h" +#include "GS/Renderers/SW/GSScanlineEnvironment.h" +#include "GS/Renderers/SW/GSNewCodeGenerator.h" #include "GS/GSUtil.h" #include "GS/MultiISA.h" -#ifdef _WIN32 -#include "common/RedtapeWindows.h" -#endif -#include - MULTI_ISA_UNSHARED_START class GSSetupPrimCodeGenerator : public Xbyak::CodeGenerator