irjit: Switch to XXH3.

This commit is contained in:
Unknown W. Brackets 2020-08-27 20:40:55 -07:00
parent 15c25be42b
commit 53d9c10b22
3 changed files with 7 additions and 7 deletions

View file

@ -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
}

View file

@ -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;

View file

@ -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();