From 6408cfdd4b391ca47f8296fe002cd1bf8adec37a Mon Sep 17 00:00:00 2001 From: Tom Lally Date: Sun, 28 Aug 2022 10:21:14 +0100 Subject: [PATCH] Replaced _rotr with std::rotr --- src/Cafe/HW/Latte/Core/LatteBufferCache.cpp | 2 +- src/Cafe/HW/Latte/Core/LatteShader.cpp | 4 ++-- src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRendererCore.cpp | 2 +- src/Cafe/HW/Latte/Renderer/Vulkan/VulkanSurfaceCopy.cpp | 6 +++--- src/Common/precompiled.h | 4 ---- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/Cafe/HW/Latte/Core/LatteBufferCache.cpp b/src/Cafe/HW/Latte/Core/LatteBufferCache.cpp index 93efdd62..7b7c28db 100644 --- a/src/Cafe/HW/Latte/Core/LatteBufferCache.cpp +++ b/src/Cafe/HW/Latte/Core/LatteBufferCache.cpp @@ -743,7 +743,7 @@ private: //h ^= *memU64; //memU64++; - h = _rotr64(h, 7); + h = std::rotr(h, 7); h += (*memU64 + (uint64)i); memU64++; } diff --git a/src/Cafe/HW/Latte/Core/LatteShader.cpp b/src/Cafe/HW/Latte/Core/LatteShader.cpp index ded1c20f..5450ba03 100644 --- a/src/Cafe/HW/Latte/Core/LatteShader.cpp +++ b/src/Cafe/HW/Latte/Core/LatteShader.cpp @@ -225,8 +225,8 @@ void LatteShader_UpdatePSInputs(uint32* contextRegisters) // parameter gen if (spi0_paramGen != 0) { - key += _rotr64(spi0_paramGen, 7); - key += _rotr64(spi0_paramGenAddr, 3); + key += std::rotr(spi0_paramGen, 7); + key += std::rotr(spi0_paramGenAddr, 3); _activePSImportTable.paramGen = spi0_paramGen; _activePSImportTable.paramGenGPR = spi0_paramGenAddr; } diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRendererCore.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRendererCore.cpp index ad84895a..d59b390c 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRendererCore.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRendererCore.cpp @@ -551,7 +551,7 @@ uint64 VulkanRenderer::GetDescriptorSetStateHash(LatteDecompilerShader* shader) hash = _rotl64(hash, 7); // hash view id + swizzle mask hash += (uint64)texture->GetUniqueId(); - hash = _rotr64(hash, 21); + hash = std::rotr(hash, 21); hash += (uint64)(word4 & 0x0FFF0000); } diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanSurfaceCopy.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanSurfaceCopy.cpp index c1751dd5..ec751dd7 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanSurfaceCopy.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanSurfaceCopy.cpp @@ -108,12 +108,12 @@ uint64 VulkanRenderer::copySurface_getPipelineStateHash(VkCopySurfaceState_t& st uint64 h = 0; h += (uintptr_t)state.destinationTexture->GetFormat(); - h = _rotr64(h, 7); + h = std::rotr(h, 7); h += state.sourceTexture->isDepth ? 0x1111ull : 0; - h = _rotr64(h, 7); + h = std::rotr(h, 7); h += state.destinationTexture->isDepth ? 0x1112ull : 0; - h = _rotr64(h, 7); + h = std::rotr(h, 7); return h; } diff --git a/src/Common/precompiled.h b/src/Common/precompiled.h index cc56ff29..6a7dcd15 100644 --- a/src/Common/precompiled.h +++ b/src/Common/precompiled.h @@ -182,10 +182,6 @@ inline uint64 _rotl64(uint64 x, sint8 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) { unsigned __int128 x = (unsigned __int128)multiplier * (unsigned __int128)multiplicand;