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


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

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


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

示例1:

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

示例2: 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;
}
开发者ID:ZilverXZX,项目名称:wiiu-emu,代码行数:16,代码来源:interpreter.cpp

示例3: jit_fallback

bool jit_fallback(PPCEmuAssembler& a, Instruction instr)
{
   auto data = gInstructionTable.decode(instr);
   auto fptr = cpu::interpreter::getInstructionHandler(data->id);
   if (!fptr) {
      throw;
   }

   if (TRACK_FALLBACK_CALLS) {
      a.mov(a.zax, reinterpret_cast<intptr_t>(&sFallbackCalls[static_cast<uint32_t>(data->id)]));
      a.lock();
      a.inc(asmjit::X86Mem(a.zax, 0));
   }

   a.mov(a.zcx, a.state);
   a.mov(a.edx, (uint32_t)instr);
   a.call(asmjit::Ptr(fptr));

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

示例4: jit_fallback

bool jit_fallback(PPCEmuAssembler& a, espresso::Instruction instr)
{
   auto data = espresso::decodeInstruction(instr);
   decaf_assert(data, fmt::format("Failed to decode instruction {:08X}", instr.value));

   auto fptr = cpu::interpreter::getInstructionHandler(data->id);
   decaf_assert(fptr, fmt::format("Unimplemented instruction {}", static_cast<int>(data->id)));

   a.evictAll();

   if (TRACK_FALLBACK_CALLS) {
      auto fallbackAddr = reinterpret_cast<intptr_t>(&sFallbackCalls[static_cast<uint32_t>(data->id)]);
      a.mov(asmjit::x86::rax, asmjit::Ptr(fallbackAddr));
      a.lock().inc(asmjit::X86Mem(asmjit::x86::rax, 0));
   }

   a.mov(a.sysArgReg[0], a.stateReg);
   a.mov(a.sysArgReg[1], (uint32_t)instr);
   a.call(asmjit::Ptr(fptr));
   return true;
}
开发者ID:degasus,项目名称:decaf-emu,代码行数:21,代码来源:jit_fallback.cpp


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