本文整理汇总了C++中PPCEmuAssembler::setl方法的典型用法代码示例。如果您正苦于以下问题:C++ PPCEmuAssembler::setl方法的具体用法?C++ PPCEmuAssembler::setl怎么用?C++ PPCEmuAssembler::setl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PPCEmuAssembler
的用法示例。
在下文中一共展示了PPCEmuAssembler::setl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Update cr0 with value
static void
updateConditionRegister(PPCEmuAssembler& a, const asmjit::X86GpReg& value, const asmjit::X86GpReg& tmp, const asmjit::X86GpReg& tmp2)
{
auto crtarget = 0;
auto crshift = (7 - crtarget) * 4;
a.mov(tmp, a.ppccr);
a.and_(tmp, ~(0xF << crshift));
a.cmp(value, 0);
a.lahf();
a.mov(tmp2, 0);
a.sete(tmp2.r8());
a.shl(tmp2, crshift + ConditionRegisterFlag::ZeroShift);
a.or_(tmp, tmp2);
a.sahf();
a.mov(tmp2, 0);
a.setg(tmp2.r8());
a.shl(tmp2, crshift + ConditionRegisterFlag::PositiveShift);
a.or_(tmp, tmp2);
a.sahf();
a.mov(tmp2, 0);
a.setl(tmp2.r8());
a.shl(tmp2, crshift + ConditionRegisterFlag::NegativeShift);
a.or_(tmp, tmp2);
a.mov(tmp2, a.ppcxer);
a.and_(tmp2, XERegisterBits::StickyOV);
a.shiftTo(tmp2, XERegisterBits::StickyOVShift, crshift + ConditionRegisterFlag::SummaryOverflowShift);
a.or_(tmp, tmp2);
a.mov(a.ppccr, tmp);
}
示例2:
static bool
cmpGeneric(PPCEmuAssembler& a, Instruction instr)
{
uint32_t crshift = (7 - instr.crfD) * 4;
// Load CRF
a.mov(a.edx, a.ppccr);
// Mask CRF
uint32_t mask = 0xFFFFFFFF;
mask &= ~(0xF << crshift);
a.and_(a.edx, mask);
// Summary Overflow
a.mov(a.eax, a.ppcxer);
a.and_(a.eax, XERegisterBits::StickyOV);
a.shr(a.eax, XERegisterBits::StickyOVShift);
a.shl(a.eax, ConditionRegisterFlag::SummaryOverflowShift << crshift);
a.or_(a.edx, a.eax);
// Perform Comparison
a.mov(a.eax, a.ppcgpr[instr.rA]);
if (flags & CmpImmediate) {
if (std::is_signed<Type>::value) {
a.mov(a.ecx, sign_extend<16>(instr.simm));
} else {
a.mov(a.ecx, instr.uimm);
}
} else {
a.mov(a.ecx, a.ppcgpr[instr.rB]);
}
a.cmp(a.eax, a.ecx);
a.mov(a.r8d, 0);
if (std::is_unsigned<Type>::value) {
a.seta(a.r8d.r8());
} else {
a.setg(a.r8d.r8());
}
a.mov(a.r9d, 0);
if (std::is_unsigned<Type>::value) {
a.setb(a.r9d.r8());
} else {
a.setl(a.r9d.r8());
}
a.mov(a.ecx, 0);
a.sete(a.ecx.r8());
a.shl(a.ecx, crshift + ConditionRegisterFlag::ZeroShift);
a.or_(a.edx, a.ecx);
a.mov(a.ecx, a.r8d);
a.shl(a.ecx, crshift + ConditionRegisterFlag::PositiveShift);
a.or_(a.edx, a.ecx);
a.mov(a.ecx, a.r9d);
a.shl(a.ecx, crshift + ConditionRegisterFlag::NegativeShift);
a.or_(a.edx, a.ecx);
a.mov(a.ppccr, a.edx);
return true;
}