From 98c904918428f7f0d4a1d0f83decc02b257da709 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Tue, 13 Jun 2023 12:20:28 -0700 Subject: [PATCH 1/2] GekkoDisassembler: Remove unread variable m_sreg --- Source/Core/Common/GekkoDisassembler.cpp | 4 ---- Source/Core/Common/GekkoDisassembler.h | 1 - 2 files changed, 5 deletions(-) diff --git a/Source/Core/Common/GekkoDisassembler.cpp b/Source/Core/Common/GekkoDisassembler.cpp index 17db752b7b..8a9bf73cd3 100644 --- a/Source/Core/Common/GekkoDisassembler.cpp +++ b/Source/Core/Common/GekkoDisassembler.cpp @@ -154,7 +154,6 @@ u32* GekkoDisassembler::m_iaddr = nullptr; std::string GekkoDisassembler::m_opcode; std::string GekkoDisassembler::m_operands; unsigned char GekkoDisassembler::m_flags = PPCF_ILLEGAL; -unsigned short GekkoDisassembler::m_sreg = 0; u32 GekkoDisassembler::m_displacement = 0; static u32 HelperRotateMask(int r, int mb, int me) @@ -927,9 +926,6 @@ void GekkoDisassembler::ldst(u32 in, std::string_view name, char reg, unsigned c int d = (u32)(in & 0xffff); m_flags |= dmode; - m_sreg = (short)a; - // if (d >= 0x8000) - // d -= 0x10000; m_displacement = (u32)d; m_opcode = name; diff --git a/Source/Core/Common/GekkoDisassembler.h b/Source/Core/Common/GekkoDisassembler.h index b7a6e7bf5f..fa4b2d75b2 100644 --- a/Source/Core/Common/GekkoDisassembler.h +++ b/Source/Core/Common/GekkoDisassembler.h @@ -105,7 +105,6 @@ private: static std::string m_opcode; // Buffer for opcode, min. 10 chars. static std::string m_operands; // Operand buffer, min. 24 chars. static unsigned char m_flags; // Additional flags - static unsigned short m_sreg; // Register in load/store instructions static u32 m_displacement; // Branch- or load/store displacement }; } // namespace Common From c8e276c6f5eb58bf4542a0235bc332def2ea7de6 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Tue, 13 Jun 2023 12:59:46 -0700 Subject: [PATCH 2/2] GekkoDisassembler: Remove unread variable m_displacement --- Source/Core/Common/GekkoDisassembler.cpp | 7 ------- Source/Core/Common/GekkoDisassembler.h | 1 - 2 files changed, 8 deletions(-) diff --git a/Source/Core/Common/GekkoDisassembler.cpp b/Source/Core/Common/GekkoDisassembler.cpp index 8a9bf73cd3..59ea32f170 100644 --- a/Source/Core/Common/GekkoDisassembler.cpp +++ b/Source/Core/Common/GekkoDisassembler.cpp @@ -154,7 +154,6 @@ u32* GekkoDisassembler::m_iaddr = nullptr; std::string GekkoDisassembler::m_opcode; std::string GekkoDisassembler::m_operands; unsigned char GekkoDisassembler::m_flags = PPCF_ILLEGAL; -u32 GekkoDisassembler::m_displacement = 0; static u32 HelperRotateMask(int r, int mb, int me) { @@ -392,7 +391,6 @@ std::string GekkoDisassembler::imm(u32 in, int uimm, int type, bool hex) { m_flags |= PPCF_UNSIGNED; } - m_displacement = i; switch (type) { @@ -582,8 +580,6 @@ void GekkoDisassembler::bc(u32 in) m_operands = fmt::format("{} ->0x{:08X}", m_operands, d); else m_operands = fmt::format("{} ->0x{:08X}", m_operands, *m_iaddr + d); - - m_displacement = d; } void GekkoDisassembler::bli(u32 in) @@ -599,8 +595,6 @@ void GekkoDisassembler::bli(u32 in) m_operands = fmt::format("->0x{:08X}", d); else m_operands = fmt::format("->0x{:08X}", *m_iaddr + d); - - m_displacement = d; } void GekkoDisassembler::mcrf(u32 in, std::string_view suffix) @@ -926,7 +920,6 @@ void GekkoDisassembler::ldst(u32 in, std::string_view name, char reg, unsigned c int d = (u32)(in & 0xffff); m_flags |= dmode; - m_displacement = (u32)d; m_opcode = name; if (reg == 'r') diff --git a/Source/Core/Common/GekkoDisassembler.h b/Source/Core/Common/GekkoDisassembler.h index fa4b2d75b2..e18fd584f9 100644 --- a/Source/Core/Common/GekkoDisassembler.h +++ b/Source/Core/Common/GekkoDisassembler.h @@ -105,6 +105,5 @@ private: static std::string m_opcode; // Buffer for opcode, min. 10 chars. static std::string m_operands; // Operand buffer, min. 24 chars. static unsigned char m_flags; // Additional flags - static u32 m_displacement; // Branch- or load/store displacement }; } // namespace Common