本文整理汇总了C++中PPCEmuAssembler类的典型用法代码示例。如果您正苦于以下问题:C++ PPCEmuAssembler类的具体用法?C++ PPCEmuAssembler怎么用?C++ PPCEmuAssembler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PPCEmuAssembler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fnmsubs
static bool
fnmsubs(PPCEmuAssembler& a, Instruction instr)
{
if (instr.rc) {
return jit_fallback(a, instr);
}
// FPSCR, FPRF supposed to be updated here...
a.movq(a.xmm0, a.ppcfpr[instr.frA]);
a.movq(a.xmm1, a.ppcfpr[instr.frC]);
a.mulsd(a.xmm0, a.xmm1);
a.movq(a.xmm1, a.ppcfpr[instr.frB]);
a.subsd(a.xmm0, a.xmm1);
a.mov(a.zax, UINT64_C(0x8000000000000000));
a.movq(a.xmm1, a.zax);
a.pxor(a.xmm0, a.xmm1);
a.cvtsd2ss(a.xmm1, a.xmm0);
a.cvtss2sd(a.xmm0, a.xmm1);
a.movq(a.ppcfpr[instr.frD], a.xmm0);
return true;
}
示例2: cntlzw
// 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;
}
示例3: mfcr
// Move from Condition Register
static bool
mfcr(PPCEmuAssembler& a, Instruction instr)
{
a.mov(a.eax, a.ppccr);
a.mov(a.ppcgpr[instr.rD], a.eax);
return true;
}
示例4: crorc
// Condition Register OR with Complement
static bool
crorc(PPCEmuAssembler& a, Instruction instr)
{
getTwoCRB(a, instr.crbA, a.eax, instr.crbB, a.ecx);
a.not_(a.ecx);
a.or_(a.eax, a.ecx);
setCRB(a, instr.crbD, a.eax, a.ecx, a.edx);
return true;
}
示例5: absXmmSd
static void
absXmmSd(PPCEmuAssembler& a,
const PPCEmuAssembler::XmmRegister& reg)
{
auto maskGp = a.allocGpTmp();
auto maskXmm = a.allocXmmTmp();
a.mov(maskGp, UINT64_C(0x7FFFFFFFFFFFFFFF));
a.movq(maskXmm, maskGp);
a.pand(reg, maskXmm);
}
示例6: negateXmmSd
static void
negateXmmSd(PPCEmuAssembler& a,
const PPCEmuAssembler::XmmRegister& reg)
{
auto maskGp = a.allocGpTmp();
auto maskXmm = a.allocXmmTmp();
a.mov(maskGp, UINT64_C(0x8000000000000000));
a.movq(maskXmm, maskGp);
a.pxor(reg, maskXmm);
}
示例7: shiftArithmetic
static bool
shiftArithmetic(PPCEmuAssembler& a, Instruction instr)
{
if (flags & ShiftImmediate && instr.sh == 0) {
// Clear Carry Flag
a.mov(a.ecx, a.ppcxer);
a.and_(a.ecx, ~XERegisterBits::Carry);
a.mov(a.ppcxer, a.ecx);
return true;
}
return jit_fallback(a, instr);
}
示例8: extsh
// Extend Sign Half Word
static bool
extsh(PPCEmuAssembler& a, Instruction instr)
{
a.mov(a.eax, a.ppcgpr[instr.rS]);
a.movsx(a.eax, a.eax.r16());
a.mov(a.ppcgpr[instr.rA], a.eax);
if (instr.rc) {
updateConditionRegister(a, a.eax, a.ecx, a.edx);
}
return true;
}
示例9: getTwoCRB
void getTwoCRB(PPCEmuAssembler& a,
uint32_t bita, const asmjit::X86GpReg& da,
uint32_t bitb, const asmjit::X86GpReg& db) {
auto shifta = 31 - bita;
auto shiftb = 31 - bitb;
a.mov(da, a.ppccr);
a.mov(db, da);
if (shifta > 0) {
a.shr(da, shifta);
}
if (shiftb > 0) {
a.shr(db, shiftb);
}
a.and_(da, 1);
a.and_(db, 1);
}
示例10: frsp
static bool
frsp(PPCEmuAssembler& a, Instruction instr)
{
if (instr.rc) {
return jit_fallback(a, instr);
}
// FPSCR, FPRF supposed to be updated here...
a.movq(a.xmm0, a.ppcfpr[instr.frB]);
a.cvtsd2ss(a.xmm1, a.xmm0);
a.cvtss2sd(a.xmm0, a.xmm1);
a.movq(a.ppcfpr[instr.frD], a.xmm0);
return true;
}
示例11: jit_fallback
bool jit_fallback(PPCEmuAssembler& a, Instruction instr)
{
auto data = gInstructionTable.decode(instr);
auto fptr = sInstructionMap[static_cast<size_t>(data->id)];
if (!fptr) {
assert(0);
}
//printf("JIT Fallback for `%s`\n", data->name);
a.mov(a.zcx, a.state);
a.mov(a.edx, (uint32_t)instr);
a.call(asmjit::Ptr(fptr));
return true;
}
示例12: nor
// NOR
static bool
nor(PPCEmuAssembler& a, Instruction instr)
{
a.mov(a.eax, a.ppcgpr[instr.rS]);
a.mov(a.ecx, a.ppcgpr[instr.rB]);
a.or_(a.eax, a.ecx);
a.not_(a.eax);
a.mov(a.ppcgpr[instr.rA], a.eax);
if (instr.rc) {
updateConditionRegister(a, a.eax, a.ecx, a.edx);
}
return true;
}
示例13: orGeneric
static bool
orGeneric(PPCEmuAssembler& a, Instruction instr)
{
a.mov(a.eax, a.ppcgpr[instr.rS]);
if (flags & OrImmediate) {
a.mov(a.ecx, instr.uimm);
} else {
a.mov(a.ecx, a.ppcgpr[instr.rB]);
}
if (flags & OrShifted) {
a.shl(a.ecx, 16);
}
if (flags & OrComplement) {
a.not_(a.ecx);
}
a.or_(a.eax, a.ecx);
a.mov(a.ppcgpr[instr.rA], a.eax);
if (flags & OrAlwaysRecord) {
updateConditionRegister(a, a.eax, a.ecx, a.edx);
} else if (flags & OrCheckRecord) {
if (instr.rc) {
updateConditionRegister(a, a.eax, a.ecx, a.edx);
}
}
return true;
}
示例14: shiftLogical
static bool
shiftLogical(PPCEmuAssembler& a, Instruction instr)
{
a.mov(a.eax, a.ppcgpr[instr.rS]);
if (flags & ShiftImmediate) {
if (flags & ShiftLeft) {
a.shl(a.eax, instr.sh);
} else if (flags & ShiftRight) {
a.shr(a.eax, instr.sh);
} else {
assert(0);
}
} else {
a.mov(a.ecx, a.ppcgpr[instr.rB]);
if (flags & ShiftLeft) {
a.shl(a.eax, a.ecx.r8());
} else if (flags & ShiftRight) {
a.shr(a.eax, a.ecx.r8());
} else {
assert(0);
}
}
a.mov(a.ppcgpr[instr.rA], a.eax);
if (instr.rc) {
updateConditionRegister(a, a.eax, a.ecx, a.edx);
}
return true;
}
示例15: frsp
static bool
frsp(PPCEmuAssembler& a, Instruction instr)
{
if (instr.rc) {
return jit_fallback(a, instr);
}
// FPSCR, FPRF supposed to be updated here...
auto dst = a.loadRegisterWrite(a.fprps[instr.frD]);
auto srcA = a.loadRegisterRead(a.fprps[instr.frB]);
a.movq(dst, srcA);
roundToSingleSd(a, dst, dst);
a.movddup(dst, dst);
return true;
}