mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
Merge 4a89300929 into ed2fe134aa
This commit is contained in:
commit
6331db73e7
@ -68,12 +68,12 @@ void CachedInterpreter::ExecuteOneBlock()
|
||||
const auto callback = *reinterpret_cast<const AnyCallback*>(normal_entry);
|
||||
const u8* payload = normal_entry + sizeof(callback);
|
||||
// Direct dispatch to the most commonly used callbacks for better performance
|
||||
if (callback == reinterpret_cast<AnyCallback>(CallbackCast(Interpret<false>))) [[likely]]
|
||||
if (callback == AnyCallbackCast(Interpret<false>)) [[likely]]
|
||||
{
|
||||
Interpret<false>(ppc_state, *reinterpret_cast<const InterpretOperands*>(payload));
|
||||
normal_entry = payload + sizeof(InterpretOperands);
|
||||
}
|
||||
else if (callback == reinterpret_cast<AnyCallback>(CallbackCast(Interpret<true>)))
|
||||
else if (callback == AnyCallbackCast(Interpret<true>))
|
||||
{
|
||||
Interpret<true>(ppc_state, *reinterpret_cast<const InterpretOperands*>(payload));
|
||||
normal_entry = payload + sizeof(InterpretOperands);
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <bit>
|
||||
#include <cstddef>
|
||||
#include <iosfwd>
|
||||
#include <type_traits>
|
||||
@ -33,7 +34,7 @@ protected:
|
||||
template <class Operands>
|
||||
static AnyCallback AnyCallbackCast(Callback<Operands> callback)
|
||||
{
|
||||
return reinterpret_cast<AnyCallback>(callback);
|
||||
return std::bit_cast<AnyCallback>(callback);
|
||||
}
|
||||
static consteval AnyCallback AnyCallbackCast(AnyCallback callback) { return callback; }
|
||||
|
||||
@ -45,7 +46,7 @@ protected:
|
||||
template <class Operands>
|
||||
static AnyDisassemble AnyDisassembleCast(Disassemble<Operands> disassemble)
|
||||
{
|
||||
return reinterpret_cast<AnyDisassemble>(disassemble);
|
||||
return std::bit_cast<AnyDisassemble>(disassemble);
|
||||
}
|
||||
static consteval AnyDisassemble AnyDisassembleCast(AnyDisassemble disassemble)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user