本文整理汇总了C++中PPCEmuAssembler::evictAll方法的典型用法代码示例。如果您正苦于以下问题:C++ PPCEmuAssembler::evictAll方法的具体用法?C++ PPCEmuAssembler::evictAll怎么用?C++ PPCEmuAssembler::evictAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PPCEmuAssembler
的用法示例。
在下文中一共展示了PPCEmuAssembler::evictAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Kernel call
static bool
kc(PPCEmuAssembler& a, Instruction instr)
{
auto id = instr.kcn;
auto kc = cpu::getKernelCall(id);
decaf_assert(kc, fmt::format("Encountered invalid Kernel Call ID {}", id));
// Evict all stored register as a KC might read or modify them.
a.evictAll();
// Save NIA back to memory in case KC reads/writes it
a.mov(a.niaMem, a.genCia + 4);
// Call the KC
a.mov(a.sysArgReg[0], asmjit::Ptr(kc->func));
a.mov(a.sysArgReg[1], asmjit::Ptr(kc->user_data));
a.call(asmjit::Ptr(&kc_stub));
a.mov(a.stateReg, asmjit::x86::rax);
// Check if the KC adjusted nia. If it has, we need to return
// to the dispatcher. Note that we assume the cache was already
// cleared before this instruction since KC requires that anyways.
auto niaUnchangedLbl = a.newLabel();
a.cmp(a.niaMem, a.genCia + 4);
a.je(niaUnchangedLbl);
a.mov(a.finaleNiaArgReg, a.niaMem);
a.mov(a.finaleJmpSrcArgReg, 0);
a.jmp(asmjit::Ptr(gFinaleFn));
a.bind(niaUnchangedLbl);
return true;
}
示例2: jit_fallback
bool jit_fallback(PPCEmuAssembler& a, espresso::Instruction instr)
{
auto data = espresso::decodeInstruction(instr);
decaf_assert(data, fmt::format("Failed to decode instruction {:08X}", instr.value));
auto fptr = cpu::interpreter::getInstructionHandler(data->id);
decaf_assert(fptr, fmt::format("Unimplemented instruction {}", static_cast<int>(data->id)));
a.evictAll();
if (TRACK_FALLBACK_CALLS) {
auto fallbackAddr = reinterpret_cast<intptr_t>(&sFallbackCalls[static_cast<uint32_t>(data->id)]);
a.mov(asmjit::x86::rax, asmjit::Ptr(fallbackAddr));
a.lock().inc(asmjit::X86Mem(asmjit::x86::rax, 0));
}
a.mov(a.sysArgReg[0], a.stateReg);
a.mov(a.sysArgReg[1], (uint32_t)instr);
a.call(asmjit::Ptr(fptr));
return true;
}