Replaced _rotr with std::rotr

This commit is contained in:
Tom Lally 2022-08-28 10:21:14 +01:00
parent 3b5eb49469
commit 6408cfdd4b
5 changed files with 7 additions and 11 deletions

View file

@ -743,7 +743,7 @@ private:
//h ^= *memU64; //h ^= *memU64;
//memU64++; //memU64++;
h = _rotr64(h, 7); h = std::rotr(h, 7);
h += (*memU64 + (uint64)i); h += (*memU64 + (uint64)i);
memU64++; memU64++;
} }

View file

@ -225,8 +225,8 @@ void LatteShader_UpdatePSInputs(uint32* contextRegisters)
// parameter gen // parameter gen
if (spi0_paramGen != 0) if (spi0_paramGen != 0)
{ {
key += _rotr64(spi0_paramGen, 7); key += std::rotr<uint64>(spi0_paramGen, 7);
key += _rotr64(spi0_paramGenAddr, 3); key += std::rotr<uint64>(spi0_paramGenAddr, 3);
_activePSImportTable.paramGen = spi0_paramGen; _activePSImportTable.paramGen = spi0_paramGen;
_activePSImportTable.paramGenGPR = spi0_paramGenAddr; _activePSImportTable.paramGenGPR = spi0_paramGenAddr;
} }

View file

@ -551,7 +551,7 @@ uint64 VulkanRenderer::GetDescriptorSetStateHash(LatteDecompilerShader* shader)
hash = _rotl64(hash, 7); hash = _rotl64(hash, 7);
// hash view id + swizzle mask // hash view id + swizzle mask
hash += (uint64)texture->GetUniqueId(); hash += (uint64)texture->GetUniqueId();
hash = _rotr64(hash, 21); hash = std::rotr(hash, 21);
hash += (uint64)(word4 & 0x0FFF0000); hash += (uint64)(word4 & 0x0FFF0000);
} }

View file

@ -108,12 +108,12 @@ uint64 VulkanRenderer::copySurface_getPipelineStateHash(VkCopySurfaceState_t& st
uint64 h = 0; uint64 h = 0;
h += (uintptr_t)state.destinationTexture->GetFormat(); h += (uintptr_t)state.destinationTexture->GetFormat();
h = _rotr64(h, 7); h = std::rotr(h, 7);
h += state.sourceTexture->isDepth ? 0x1111ull : 0; h += state.sourceTexture->isDepth ? 0x1111ull : 0;
h = _rotr64(h, 7); h = std::rotr(h, 7);
h += state.destinationTexture->isDepth ? 0x1112ull : 0; h += state.destinationTexture->isDepth ? 0x1112ull : 0;
h = _rotr64(h, 7); h = std::rotr(h, 7);
return h; return h;
} }

View file

@ -182,10 +182,6 @@ inline uint64 _rotl64(uint64 x, sint8 r)
return (x << r) | (x >> (64 - r)); return (x << r) | (x >> (64 - r));
} }
inline uint64 _rotr64(uint64 x, sint8 r)
{
return (x >> r) | (x << (64 - r));
}
inline uint64 _umul128(uint64 multiplier, uint64 multiplicand, uint64 *highProduct) { inline uint64 _umul128(uint64 multiplier, uint64 multiplicand, uint64 *highProduct) {
unsigned __int128 x = (unsigned __int128)multiplier * (unsigned __int128)multiplicand; unsigned __int128 x = (unsigned __int128)multiplier * (unsigned __int128)multiplicand;