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


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

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


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

示例1: if

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

示例2: updateConditionRegister

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

   if (flags & XorImmediate) {
      a.mov(a.ecx, instr.uimm);
   } else {
      a.mov(a.ecx, a.ppcgpr[instr.rB]);
   }

   if (flags & XorShifted) {
      a.shl(a.ecx, 16);
   }

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

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

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

示例3:

// 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

示例4: 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

示例5:

// 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

示例6: jit_fallback

static bool
addGeneric(PPCEmuAssembler& a, Instruction instr)
{
   if (flags & AddSubtract) {
      return jit_fallback(a, instr);
   }

   bool recordCarry = false;
   bool recordOverflow = false;
   bool recordCond = false;

   if (flags & AddCarry) {
      recordCarry = true;
   }

   if (flags & AddAlwaysRecord) {
      recordOverflow = true;
      recordCond = true;
   } else if (flags & AddCheckRecord) {
      if (instr.oe) {
         recordOverflow = true;
      }

      if (instr.rc) {
         recordCond = true;
      }
   }

   if ((flags & AddZeroRA) && instr.rA == 0) {
      a.mov(a.eax, 0);
   } else {
      a.mov(a.eax, a.ppcgpr[instr.rA]);
   }

   if (flags & AddSubtract) {
      a.not_(a.eax);
   }

   if (flags & AddImmediate) {
      a.mov(a.ecx, sign_extend<16>(instr.simm));
   } else if (flags & AddToZero) {
      a.mov(a.ecx, 0);
   } else if (flags & AddToMinusOne) {
      a.mov(a.ecx, -1);
   } else {
      a.mov(a.ecx, a.ppcgpr[instr.rB]);
   }

   if (flags & AddShifted) {
      a.shl(a.ecx, 16);
   }

   // Mark x64 CF based on PPC CF
   if (flags & AddExtended) {
      a.mov(a.edx, a.ppcxer);
      a.and_(a.edx, XERegisterBits::Carry);
      a.add(a.edx, 0xffffffff);

      a.adc(a.eax, a.ecx);
   } else if (flags & AddSubtract) {
      a.stc();

      a.adc(a.eax, a.ecx);
   } else {
      a.add(a.eax, a.ecx);
   }

   if (recordCarry && recordOverflow) {
      a.mov(a.ecx, 0);
      a.setc(a.ecx.r8());
      a.mov(a.edx, 0);
      a.seto(a.edx.r8());

      a.shl(a.ecx, XERegisterBits::CarryShift);
      a.shl(a.edx, XERegisterBits::OverflowShift);
      a.or_(a.ecx, a.edx);
   } else if (recordCarry) {
      a.mov(a.ecx, 0);
      a.setc(a.ecx.r8());
      a.shl(a.ecx, XERegisterBits::CarryShift);
   } else if (recordOverflow) {
      a.mov(a.ecx, 0);
      a.seto(a.ecx.r8());
      a.shl(a.ecx, XERegisterBits::OverflowShift);
   }

   if (recordCarry || recordOverflow) {
      uint32_t mask = 0xFFFFFFFF;

      if (recordCarry) {
         mask &= ~XERegisterBits::Carry;
      }

      if (recordOverflow) {
         mask &= ~XERegisterBits::Overflow;
      }

      a.mov(a.edx, a.ppcxer);
      a.and_(a.edx, mask);
      a.or_(a.edx, a.ecx);
//.........这里部分代码省略.........
开发者ID:archshift,项目名称:decaf-emu,代码行数:101,代码来源:jit_integer.cpp


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