예제 #1
0
void bgezall() {
  // if (_rs.0-63 >= 0) delayslot = instaddr + 4 + _offset * 4
  enum { _jump, _end };
  
  mov32_mem_imm32((u32)&g_cpu->m_ra.d[0], g_cpu->m_recompiling_ee_va + 8);
  mov32_mem_imm32((u32)&g_cpu->m_ra.d[1], 0x00000000);

  // 符号ビットが0ならジャンプ
  mov32_eax_mem(_GPR_D(_rs, 1));
  tst32_reg_reg(_eax, _eax);
  jns(_jump);
  // 分岐しない場合、次の遅延スロットの命令を実行しない
  mov8_mem_imm8((u32)&g_cpu->m_null_current_inst, 1);
  jmp(_end);
LABEL_DEF(_jump);
  mov32_reg_imm32(_eax, (g_cpu->m_recompiling_ee_va + 4) + _offset * 4);
  mov32_mem_eax((u32)&g_cpu->m_ee_jump_addr);

#if defined _DEBUGGER
  push_reg(_eax);  // eaxはジャンプ先
  mov32_reg_imm32(_eax, (u32)Debugger::callStackPush);
  call_reg(_eax);
  pop_reg(_eax);

  mov32_reg_imm32(_eax, (u32)Debugger::jumpLogPush);
  call_reg(_eax);
#endif

LABEL_DEF(_end);
}
예제 #2
0
void bltzal() {
  // if (_rs.0-63 < 0) delayslot = instaddr + 4 + _offset * 4
  enum { _end };
  
  mov32_mem_imm32((u32)&g_cpu->m_ra.d[0], g_cpu->m_recompiling_ee_va + 8);
  mov32_mem_imm32((u32)&g_cpu->m_ra.d[1], 0x00000000);

  // 符号ビットが0ならジャンプしない
  mov32_eax_mem(_GPR_D(_rs, 1));
  tst32_reg_reg(_eax, _eax);
  jns(_end);
  mov32_reg_imm32(_eax, (g_cpu->m_recompiling_ee_va + 4) + _offset * 4);
  mov32_mem_eax((u32)&g_cpu->m_ee_jump_addr);

#if defined _DEBUGGER
  push_reg(_eax);  // eaxはジャンプ先
  mov32_reg_imm32(_eax, (u32)Debugger::callStackPush);
  call_reg(_eax);
  pop_reg(_eax);

  mov32_reg_imm32(_eax, (u32)Debugger::jumpLogPush);
  call_reg(_eax);
#endif

LABEL_DEF(_end);
}
예제 #3
0
jit_value pop_int(Frame* frame) {
	jit_value reg = pop_reg(frame);
	struct jit* jit = frame->jit;
	
	jit_ldxi(jit, frame->accum[1], reg, offsetof(YValue, type), sizeof(void*));
	jit_movi(jit, frame->accum[2], 0);
	jit_op* not_int_jump = jit_bner(jit, (intptr_t) JIT_FORWARD, frame->accum[1], frame->IntType);

	jit_ldxi(jit, frame->accum[2], reg, offsetof(YInteger, value), sizeof(int64_t));

	jit_patch(jit, not_int_jump);
	jit_movr(jit, frame->accum[0], frame->accum[2]);
	return frame->accum[0];
}
예제 #4
0
void CAssembler::arg_reg_fd(uint32_t* opcode)
{
    *opcode |= pop_reg() << 6;
}
예제 #5
0
void CAssembler::arg_reg_s(uint32_t* opcode)
{
	*opcode |= pop_reg() << 21;
}