diff options
Diffstat (limited to 'Source/Core/Common/FloatUtils.cpp')
| -rw-r--r-- | Source/Core/Common/FloatUtils.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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 <bit> #include <cmath> -#include "Common/BitUtils.h" - namespace Common { u32 ClassifyDouble(double dvalue) { - const u64 ivalue = BitCast<u64>(dvalue); + const u64 ivalue = std::bit_cast<u64>(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<u32>(fvalue); + const u32 ivalue = std::bit_cast<u32>(fvalue); const u32 sign = ivalue & FLOAT_SIGN; const u32 exp = ivalue & FLOAT_EXP; @@ -86,7 +85,7 @@ const std::array<BaseAndDec, 32> frsqrte_expected = {{ double ApproximateReciprocalSquareRoot(double val) { - s64 integral = BitCast<s64>(val); + s64 integral = std::bit_cast<s64>(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<s64>(entry.m_base + entry.m_dec * (i % 2048)) << 26; - return BitCast<double>(integral); + return std::bit_cast<double>(integral); } const std::array<BaseAndDec, 32> fres_expected = {{ @@ -152,7 +151,7 @@ const std::array<BaseAndDec, 32> fres_expected = {{ // Used by fres and ps_res. double ApproximateReciprocal(double val) { - s64 integral = BitCast<s64>(val); + s64 integral = std::bit_cast<s64>(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<s64>(entry.m_base - (entry.m_dec * (i % 1024) + 1) / 2) << 29; - return BitCast<double>(integral); + return std::bit_cast<double>(integral); } } // namespace Common |
