mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Replace Common::BitCast with std::bit_cast
This commit is contained in:
@ -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++)
|
||||
|
Reference in New Issue
Block a user