diff --git a/src/backend/x64/a32_jitstate.cpp b/src/backend/x64/a32_jitstate.cpp index bd170345..4e5b2d2b 100644 --- a/src/backend/x64/a32_jitstate.cpp +++ b/src/backend/x64/a32_jitstate.cpp @@ -196,7 +196,7 @@ void A32JitState::SetFpscr(u32 FPSCR) { } } -u64 A32JitState::GetUniqueHash() const { +u64 A32JitState::GetUniqueHash() const noexcept { return CPSR_et | FPSCR_mode | (static_cast(Reg[15]) << 32); } diff --git a/src/backend/x64/a32_jitstate.h b/src/backend/x64/a32_jitstate.h index c02a44ad..9f6a23b7 100644 --- a/src/backend/x64/a32_jitstate.h +++ b/src/backend/x64/a32_jitstate.h @@ -76,7 +76,7 @@ struct A32JitState { u32 Fpscr() const; void SetFpscr(u32 FPSCR); - u64 GetUniqueHash() const; + u64 GetUniqueHash() const noexcept; }; #ifdef _MSC_VER diff --git a/src/backend/x64/a64_jitstate.cpp b/src/backend/x64/a64_jitstate.cpp index eeb7fdb3..b3b2b93a 100644 --- a/src/backend/x64/a64_jitstate.cpp +++ b/src/backend/x64/a64_jitstate.cpp @@ -10,9 +10,9 @@ namespace Dynarmic::BackendX64 { -u64 A64JitState::GetUniqueHash() const { - u64 fpcr_u64 = static_cast(fpcr & A64::LocationDescriptor::FPCR_MASK) << 37; - u64 pc_u64 = pc & A64::LocationDescriptor::PC_MASK; +u64 A64JitState::GetUniqueHash() const noexcept { + const u64 fpcr_u64 = static_cast(fpcr & A64::LocationDescriptor::FPCR_MASK) << 37; + const u64 pc_u64 = pc & A64::LocationDescriptor::PC_MASK; return pc_u64 | fpcr_u64; } diff --git a/src/backend/x64/a64_jitstate.h b/src/backend/x64/a64_jitstate.h index ad7eb7b5..74385280 100644 --- a/src/backend/x64/a64_jitstate.h +++ b/src/backend/x64/a64_jitstate.h @@ -81,7 +81,7 @@ struct A64JitState { void SetFpcr(u32 new_fpcr); void SetFpsr(u32 new_fpcr); - u64 GetUniqueHash() const; + u64 GetUniqueHash() const noexcept; }; #ifdef _MSC_VER diff --git a/src/frontend/A32/location_descriptor.h b/src/frontend/A32/location_descriptor.h index 78e9c3d7..d2ec0c8b 100644 --- a/src/frontend/A32/location_descriptor.h +++ b/src/frontend/A32/location_descriptor.h @@ -79,13 +79,13 @@ public: return LocationDescriptor(arm_pc, cpsr, A32::FPSCR{new_fpscr & FPSCR_MODE_MASK}); } - u64 UniqueHash() const { + u64 UniqueHash() const noexcept { // This value MUST BE UNIQUE. // This calculation has to match up with EmitX64::EmitTerminalPopRSBHint - u64 pc_u64 = u64(arm_pc) << 32; - u64 fpscr_u64 = u64(fpscr.Value()); - u64 t_u64 = cpsr.T() ? 1 : 0; - u64 e_u64 = cpsr.E() ? 2 : 0; + const u64 pc_u64 = u64(arm_pc) << 32; + const u64 fpscr_u64 = u64(fpscr.Value()); + const u64 t_u64 = cpsr.T() ? 1 : 0; + const u64 e_u64 = cpsr.E() ? 2 : 0; return pc_u64 | fpscr_u64 | t_u64 | e_u64; } @@ -112,13 +112,13 @@ std::ostream& operator<<(std::ostream& o, const LocationDescriptor& descriptor); namespace std { template <> struct less { - bool operator()(const Dynarmic::A32::LocationDescriptor& x, const Dynarmic::A32::LocationDescriptor& y) const { + bool operator()(const Dynarmic::A32::LocationDescriptor& x, const Dynarmic::A32::LocationDescriptor& y) const noexcept { return x.UniqueHash() < y.UniqueHash(); } }; template <> struct hash { - size_t operator()(const Dynarmic::A32::LocationDescriptor& x) const { + size_t operator()(const Dynarmic::A32::LocationDescriptor& x) const noexcept { return std::hash()(x.UniqueHash()); } }; diff --git a/src/frontend/A64/location_descriptor.h b/src/frontend/A64/location_descriptor.h index 9cea06a6..4d19bd05 100644 --- a/src/frontend/A64/location_descriptor.h +++ b/src/frontend/A64/location_descriptor.h @@ -51,10 +51,10 @@ public: return LocationDescriptor(static_cast(pc + amount), fpcr); } - u64 UniqueHash() const { + u64 UniqueHash() const noexcept { // This value MUST BE UNIQUE. // This calculation has to match up with EmitTerminalPopRSBHint - u64 fpcr_u64 = static_cast(fpcr.Value()) << 37; + const u64 fpcr_u64 = static_cast(fpcr.Value()) << 37; return pc | fpcr_u64; } @@ -80,13 +80,13 @@ std::ostream& operator<<(std::ostream& o, const LocationDescriptor& descriptor); namespace std { template <> struct less { - bool operator()(const Dynarmic::A64::LocationDescriptor& x, const Dynarmic::A64::LocationDescriptor& y) const { + bool operator()(const Dynarmic::A64::LocationDescriptor& x, const Dynarmic::A64::LocationDescriptor& y) const noexcept { return x.UniqueHash() < y.UniqueHash(); } }; template <> struct hash { - size_t operator()(const Dynarmic::A64::LocationDescriptor& x) const { + size_t operator()(const Dynarmic::A64::LocationDescriptor& x) const noexcept { return std::hash()(x.UniqueHash()); } }; diff --git a/src/frontend/ir/location_descriptor.h b/src/frontend/ir/location_descriptor.h index 5fd61f7f..89d06db3 100644 --- a/src/frontend/ir/location_descriptor.h +++ b/src/frontend/ir/location_descriptor.h @@ -38,13 +38,13 @@ std::ostream& operator<<(std::ostream& o, const LocationDescriptor& descriptor); namespace std { template <> struct less { - bool operator()(const Dynarmic::IR::LocationDescriptor& x, const Dynarmic::IR::LocationDescriptor& y) const { + bool operator()(const Dynarmic::IR::LocationDescriptor& x, const Dynarmic::IR::LocationDescriptor& y) const noexcept { return x.Value() < y.Value(); } }; template <> struct hash { - size_t operator()(const Dynarmic::IR::LocationDescriptor& x) const { + size_t operator()(const Dynarmic::IR::LocationDescriptor& x) const noexcept { return std::hash()(x.Value()); } };