From 5d5b14de47e290f9ca5dbaf9301cd5741889a19f Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 23 Nov 2016 08:52:05 +1100 Subject: [PATCH] [Project64] Add CArmRegInfo::operator== --- .../N64System/Recompiler/Arm/ArmRegInfo.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmRegInfo.cpp b/Source/Project64-core/N64System/Recompiler/Arm/ArmRegInfo.cpp index 0148d1b67..eb0758e12 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmRegInfo.cpp +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmRegInfo.cpp @@ -63,6 +63,29 @@ CArmRegInfo& CArmRegInfo::operator=(const CArmRegInfo& right) return *this; } +bool CArmRegInfo::operator==(const CArmRegInfo& right) const +{ + if (!CRegBase::operator==(right)) + { + return false; + } + + for (int32_t count = 0; count < 32; count++) + { + if (m_RegMapHi[count] != right.m_RegMapHi[count]) { return false; } + if (m_RegMapLo[count] != right.m_RegMapLo[count]) { return false; } + } + + for (int32_t count = 0; count < 16; count++) + { + if (m_ArmReg_MapOrder[count] != right.m_ArmReg_MapOrder[count]) { return false; } + if (m_ArmReg_Protected[count] != right.m_ArmReg_Protected[count]) { return false; } + if (m_ArmReg_MappedTo[count] != right.m_ArmReg_MappedTo[count]) { return false; } + if (m_Variable_MappedTo[count] != right.m_Variable_MappedTo[count]) { return false; } + } + return true; +} + bool CArmRegInfo::ShouldPushPopReg (ArmReg Reg) { if (m_ArmReg_MappedTo[Reg] == NotMapped)