当前位置: 首页>>代码示例>>C++>>正文


C++ PPCEmuAssembler::and_方法代码示例

本文整理汇总了C++中PPCEmuAssembler::and_方法的典型用法代码示例。如果您正苦于以下问题:C++ PPCEmuAssembler::and_方法的具体用法?C++ PPCEmuAssembler::and_怎么用?C++ PPCEmuAssembler::and_使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PPCEmuAssembler的用法示例。


在下文中一共展示了PPCEmuAssembler::and_方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

static bool
rlwGeneric(PPCEmuAssembler& a, Instruction instr)
{
   a.mov(a.eax, a.ppcgpr[instr.rS]);

   if (flags & RlwImmediate) {
      a.rol(a.eax, instr.sh);
   } else {
      a.mov(a.ecx, a.ppcgpr[instr.rB]);
      a.and_(a.ecx, 0x1f);
      a.rol(a.eax, a.ecx.r8());
   }

   auto m = make_ppc_bitmask(instr.mb, instr.me);

   if (flags & RlwAnd) {
      a.and_(a.eax, m);
   } else if (flags & RlwInsert) {
      a.and_(a.eax, m);
      a.mov(a.ecx, a.ppcgpr[instr.rA]);
      a.and_(a.ecx, ~m);
      a.or_(a.eax, a.ecx);
   }

   a.mov(a.ppcgpr[instr.rA], a.eax);

   if (instr.rc) {
      updateConditionRegister(a, a.eax, a.ecx, a.edx);
   }

   return true;
}
开发者ID:archshift,项目名称:decaf-emu,代码行数:32,代码来源:jit_integer.cpp

示例2:

// Move to Condition Register from XER
static bool
mcrxr(PPCEmuAssembler& a, Instruction instr)
{
   uint32_t crshift = (7 - instr.crfD) * 4;

   a.mov(a.eax, a.ppcxer);
   a.mov(a.ecx, a.eax);

   // Grab CRXR
   a.shr(a.ecx, XERegisterBits::XRShift);
   a.and_(a.ecx, 0xF);

   // Clear XER CRXR
   a.and_(a.eax, ~XERegisterBits::XR);
   a.mov(a.ppcxer, a.eax);

   // Set CRF
   a.shl(a.ecx, crshift);
   a.mov(a.eax, a.ppccr);
   a.and_(a.eax, ~(0xF << crshift));
   a.or_(a.eax, a.ecx);
   a.mov(a.ppccr, a.eax);

   return true;
}
开发者ID:ZilverXZX,项目名称:wiiu-emu,代码行数:26,代码来源:jit_condition.cpp

示例3: setCRB

void setCRB(PPCEmuAssembler& a, uint32_t bit, const asmjit::X86GpReg& value, const asmjit::X86GpReg& tmp, const asmjit::X86GpReg& tmp2) {
   auto shift = 31 - bit;
   a.mov(tmp, a.ppccr);
   a.and_(tmp, ~(1 << shift));
   a.mov(tmp2, value);
   a.and_(tmp2, 1);
   a.shl(tmp2, shift);
   a.or_(tmp, tmp2);
   a.mov(a.ppccr, tmp);
}
开发者ID:ZilverXZX,项目名称:wiiu-emu,代码行数:10,代码来源:jit_condition.cpp

示例4: updateConditionRegister

// Negate
static bool
neg(PPCEmuAssembler& a, Instruction instr)
{
   a.mov(a.eax, a.ppcgpr[instr.rA]);
   a.neg(a.eax);
   a.mov(a.ppcgpr[instr.rD], a.eax);

   if (instr.oe) {
      a.mov(a.ecx, 0);
      a.seto(a.ecx.r8());

      // Reset overflow
      a.mov(a.edx, a.ppcxer);
      a.and_(a.edx, ~XERegisterBits::Overflow);

      a.shiftTo(a.ecx, 0, XERegisterBits::Overflow);
      a.or_(a.edx, a.ecx);
      a.shiftTo(a.ecx, XERegisterBits::Overflow, XERegisterBits::StickyOV);
      a.or_(a.edx, a.ecx);

      a.mov(a.ppcxer, a.edx);
   }

   if (instr.rc) {
      updateConditionRegister(a, a.eax, a.ecx, a.edx);
   }

   return true;
}
开发者ID:archshift,项目名称:decaf-emu,代码行数:30,代码来源:jit_integer.cpp

示例5: getTwoCRB

// Condition Register AND
static bool
crand(PPCEmuAssembler& a, Instruction instr)
{
   getTwoCRB(a, instr.crbA, a.eax, instr.crbB, a.ecx);
   a.and_(a.eax, a.ecx);
   setCRB(a, instr.crbD, a.eax, a.ecx, a.edx);
   return true;
}
开发者ID:ZilverXZX,项目名称:wiiu-emu,代码行数:9,代码来源:jit_condition.cpp

示例6: jit_fallback

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);
}
开发者ID:archshift,项目名称:decaf-emu,代码行数:13,代码来源:jit_integer.cpp

示例7:

// 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);
}
开发者ID:archshift,项目名称:decaf-emu,代码行数:37,代码来源:jit_integer.cpp

示例8:

// Data Cache Block Zero
static bool
dcbz(PPCEmuAssembler& a, Instruction instr)
{
   auto src = a.allocGpTmp().r32();

   if (instr.rA == 0) {
      a.mov(src, 0);
   } else {
      a.mov(src, a.loadRegisterRead(a.gpr[instr.rA]));
   }

   a.add(src, a.loadRegisterRead(a.gpr[instr.rB]));

   // Align down
   a.and_(src, ~static_cast<uint32_t>(31));

   // Write 32 bytes of zero's there
   a.mov(asmjit::X86Mem(a.membaseReg, src, 0, 0, 8), 0);
   a.mov(asmjit::X86Mem(a.membaseReg, src, 0, 8, 8), 0);
   a.mov(asmjit::X86Mem(a.membaseReg, src, 0, 16, 8), 0);
   a.mov(asmjit::X86Mem(a.membaseReg, src, 0, 24, 8), 0);

   return true;
}
开发者ID:achurch,项目名称:decaf-emu,代码行数:25,代码来源:jit_system.cpp


注:本文中的PPCEmuAssembler::and_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。