本文整理汇总了C++中PPCEmuAssembler::bind方法的典型用法代码示例。如果您正苦于以下问题:C++ PPCEmuAssembler::bind方法的具体用法?C++ PPCEmuAssembler::bind怎么用?C++ PPCEmuAssembler::bind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PPCEmuAssembler
的用法示例。
在下文中一共展示了PPCEmuAssembler::bind方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lblZero
// Count Leading Zeroes Word
static bool
cntlzw(PPCEmuAssembler& a, Instruction instr)
{
asmjit::Label lblZero(a);
a.mov(a.ecx, a.ppcgpr[instr.rS]);
a.mov(a.eax, 32);
a.cmp(a.ecx, 0);
a.je(lblZero);
a.mov(a.edx, 0);
a.bsr(a.edx, a.ecx);
a.dec(a.eax);
a.sub(a.eax, a.edx);
a.bind(lblZero);
a.mov(a.ppcgpr[instr.rA], a.eax);
if (instr.rc) {
updateConditionRegister(a, a.eax, a.ecx, a.edx);
}
return true;
}
示例2:
// 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;
}