From fbbfea8e8e536800a6a911eb90cecdd1f343f9e3 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Fri, 5 Aug 2022 21:10:17 -0700 Subject: Replace Common::BitCast with std::bit_cast --- Source/Core/Common/FloatUtils.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Source/Core/Common/FloatUtils.cpp') diff --git a/Source/Core/Common/FloatUtils.cpp b/Source/Core/Common/FloatUtils.cpp index dbe2a0b508..a671eb278c 100644 --- a/Source/Core/Common/FloatUtils.cpp +++ b/Source/Core/Common/FloatUtils.cpp @@ -3,15 +3,14 @@ #include "Common/FloatUtils.h" +#include #include -#include "Common/BitUtils.h" - namespace Common { u32 ClassifyDouble(double dvalue) { - const u64 ivalue = BitCast(dvalue); + const u64 ivalue = std::bit_cast(dvalue); const u64 sign = ivalue & DOUBLE_SIGN; const u64 exp = ivalue & DOUBLE_EXP; @@ -43,7 +42,7 @@ u32 ClassifyDouble(double dvalue) u32 ClassifyFloat(float fvalue) { - const u32 ivalue = BitCast(fvalue); + const u32 ivalue = std::bit_cast(fvalue); const u32 sign = ivalue & FLOAT_SIGN; const u32 exp = ivalue & FLOAT_EXP; @@ -86,7 +85,7 @@ const std::array frsqrte_expected = {{ double ApproximateReciprocalSquareRoot(double val) { - s64 integral = BitCast(val); + s64 integral = std::bit_cast(val); s64 mantissa = integral & ((1LL << 52) - 1); const s64 sign = integral & (1ULL << 63); s64 exponent = integral & (0x7FFLL << 52); @@ -136,7 +135,7 @@ double ApproximateReciprocalSquareRoot(double val) const auto& entry = frsqrte_expected[i / 2048]; integral |= static_cast(entry.m_base + entry.m_dec * (i % 2048)) << 26; - return BitCast(integral); + return std::bit_cast(integral); } const std::array fres_expected = {{ @@ -152,7 +151,7 @@ const std::array fres_expected = {{ // Used by fres and ps_res. double ApproximateReciprocal(double val) { - s64 integral = BitCast(val); + s64 integral = std::bit_cast(val); const s64 mantissa = integral & ((1LL << 52) - 1); const s64 sign = integral & (1ULL << 63); s64 exponent = integral & (0x7FFLL << 52); @@ -184,7 +183,7 @@ double ApproximateReciprocal(double val) integral = sign | exponent; integral |= static_cast(entry.m_base - (entry.m_dec * (i % 1024) + 1) / 2) << 29; - return BitCast(integral); + return std::bit_cast(integral); } } // namespace Common -- cgit v1.2.3