Replace Common::BitCast with std::bit_cast

This commit is contained in:
Pokechu22
2022-08-05 21:10:17 -07:00
parent 57c890d4fc
commit fbbfea8e8e
36 changed files with 177 additions and 215 deletions

View File

@ -1,13 +1,13 @@
// Copyright 2021 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <bit>
#include <cstddef>
#include <random>
#include <type_traits>
#include "Common/Arm64Emitter.h"
#include "Common/Assert.h"
#include "Common/BitUtils.h"
#include <gtest/gtest.h>
@ -33,7 +33,7 @@ public:
FlushIcacheSection(const_cast<u8*>(fn), const_cast<u8*>(GetCodePtr()));
const u64 result = Common::BitCast<u64 (*)()>(fn)();
const u64 result = std::bit_cast<u64 (*)()>(fn)();
EXPECT_EQ(value, result);
}
@ -50,7 +50,7 @@ public:
FlushIcacheSection(const_cast<u8*>(fn), const_cast<u8*>(GetCodePtr()));
const u64 result = Common::BitCast<u64 (*)()>(fn)();
const u64 result = std::bit_cast<u64 (*)()>(fn)();
EXPECT_EQ(value, result);
}
};
@ -115,7 +115,7 @@ TEST(JitArm64, MovI2R_LogImm)
TEST(JitArm64, MovI2R_ADP)
{
TestMovI2R test;
const u64 base = Common::BitCast<u64>(test.GetCodePtr());
const u64 base = std::bit_cast<u64>(test.GetCodePtr());
// Test offsets around 0
for (s64 i = -0x20000; i < 0x20000; i++)
@ -138,7 +138,7 @@ TEST(JitArm64, MovI2R_ADP)
TEST(JitArm64, MovI2R_ADRP)
{
TestMovI2R test;
const u64 base = Common::BitCast<u64>(test.GetCodePtr()) & ~0xFFF;
const u64 base = std::bit_cast<u64>(test.GetCodePtr()) & ~0xFFF;
// Test offsets around 0
for (s64 i = -0x20000; i < 0x20000; i++)