mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #11966 from Dentomologist/convert_xemitter_prefetchlevel_to_enum_class
xEmitter: Convert PrefetchLevel to enum class
This commit is contained in:
commit
8039d10994
@ -920,7 +920,7 @@ void XEmitter::UD2()
|
||||
void XEmitter::PREFETCH(PrefetchLevel level, OpArg arg)
|
||||
{
|
||||
ASSERT_MSG(DYNA_REC, !arg.IsImm(), "PREFETCH - Imm argument");
|
||||
arg.operandReg = (u8)level;
|
||||
arg.operandReg = static_cast<u8>(level);
|
||||
arg.WriteREX(this, 0, 0);
|
||||
Write8(0x0F);
|
||||
Write8(0x18);
|
||||
|
@ -481,12 +481,12 @@ public:
|
||||
void BSR(int bits, X64Reg dest, const OpArg& src); // Top bit to bottom bit
|
||||
|
||||
// Cache control
|
||||
enum PrefetchLevel
|
||||
enum class PrefetchLevel : u8
|
||||
{
|
||||
PF_NTA, // Non-temporal (data used once and only once)
|
||||
PF_T0, // All cache levels
|
||||
PF_T1, // Levels 2+ (aliased to T0 on AMD)
|
||||
PF_T2, // Levels 3+ (aliased to T0 on AMD)
|
||||
NTA = 0, // Non-temporal (data used once and only once)
|
||||
T0 = 1, // All cache levels
|
||||
T1 = 2, // Levels 2+ (aliased to T0 on AMD)
|
||||
T2 = 3, // Levels 3+ (aliased to T0 on AMD)
|
||||
};
|
||||
void PREFETCH(PrefetchLevel level, OpArg arg);
|
||||
void MOVNTI(int bits, const OpArg& dest, X64Reg src);
|
||||
|
@ -380,10 +380,10 @@ BITSEARCH_TEST(TZCNT);
|
||||
|
||||
TEST_F(x64EmitterTest, PREFETCH)
|
||||
{
|
||||
emitter->PREFETCH(XEmitter::PF_NTA, MatR(R12));
|
||||
emitter->PREFETCH(XEmitter::PF_T0, MatR(R12));
|
||||
emitter->PREFETCH(XEmitter::PF_T1, MatR(R12));
|
||||
emitter->PREFETCH(XEmitter::PF_T2, MatR(R12));
|
||||
emitter->PREFETCH(XEmitter::PrefetchLevel::NTA, MatR(R12));
|
||||
emitter->PREFETCH(XEmitter::PrefetchLevel::T0, MatR(R12));
|
||||
emitter->PREFETCH(XEmitter::PrefetchLevel::T1, MatR(R12));
|
||||
emitter->PREFETCH(XEmitter::PrefetchLevel::T2, MatR(R12));
|
||||
|
||||
ExpectDisassembly("prefetchnta byte ptr ds:[r12] "
|
||||
"prefetcht0 byte ptr ds:[r12] "
|
||||
|
Loading…
Reference in New Issue
Block a user