From 53d9c10b22dfda9236e33960c49fb5ab59b86f59 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 27 Aug 2020 20:40:55 -0700 Subject: [PATCH] irjit: Switch to XXH3. --- Core/Debugger/DisassemblyManager.cpp | 6 +++--- Core/MIPS/IR/IRJit.cpp | 2 +- UI/CwCheatScreen.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/Debugger/DisassemblyManager.cpp b/Core/Debugger/DisassemblyManager.cpp index b04c40cc16..d05a0984b6 100644 --- a/Core/Debugger/DisassemblyManager.cpp +++ b/Core/Debugger/DisassemblyManager.cpp @@ -41,12 +41,12 @@ bool isInInterval(u32 start, u32 size, u32 value) } -static u32 computeHash(u32 address, u32 size) +static HashType computeHash(u32 address, u32 size) { #ifdef _M_X64 - return XXH64(Memory::GetPointer(address), size, 0xBACD7814BACD7814LL); + return XXH3_64bits(Memory::GetPointer(address), size); #else - return XXH32(Memory::GetPointer(address), size, 0xBACD7814); + return XXH3_64bits(Memory::GetPointer(address), size) & 0xFFFFFFFF; #endif } diff --git a/Core/MIPS/IR/IRJit.cpp b/Core/MIPS/IR/IRJit.cpp index ec279776cd..4324d3ba8f 100644 --- a/Core/MIPS/IR/IRJit.cpp +++ b/Core/MIPS/IR/IRJit.cpp @@ -481,7 +481,7 @@ u64 IRBlock::CalculateHash() const { buffer[pos++] = instr.encoding; } - return XXH64(&buffer[0], origSize_, 0x9A5C33B8); + return XXH3_64bits(&buffer[0], origSize_); } return 0; diff --git a/UI/CwCheatScreen.cpp b/UI/CwCheatScreen.cpp index dad1ac5861..a5c040d029 100644 --- a/UI/CwCheatScreen.cpp +++ b/UI/CwCheatScreen.cpp @@ -16,7 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "base/stringutil.h" -#include "ext/cityhash/city.h" +#include "ext/xxhash.h" #include "i18n/i18n.h" #include "ui/ui.h" #include "util/text/utf8.h" @@ -62,7 +62,7 @@ void CwCheatScreen::LoadCheatInfo() { // We won't parse this, just using it to detect changes to the file. std::string str; if (readFileToString(true, engine_->CheatFilename().c_str(), str)) { - fileCheckHash_ = CityHash64(str.c_str(), str.size()); + fileCheckHash_ = XXH3_64bits(str.c_str(), str.size()); } fileCheckCounter_ = 0; @@ -119,7 +119,7 @@ void CwCheatScreen::update() { // Check if the file has changed. If it has, we'll reload. std::string str; if (readFileToString(true, engine_->CheatFilename().c_str(), str)) { - uint64_t newHash = CityHash64(str.c_str(), str.size()); + uint64_t newHash = XXH3_64bits(str.c_str(), str.size()); if (newHash != fileCheckHash_) { // This will update the hash. RecreateViews();