void dCILInstrMove::EmitOpcode(dVirtualMachine::dOpCode* const codeOutPtr) const { dVirtualMachine::dOpCode& code = codeOutPtr[m_byteCodeOffset]; code.m_type3.m_opcode = unsigned (dVirtualMachine::m_mov); code.m_type3.m_reg0 = RegisterToIndex(m_arg0.m_label); code.m_type3.m_reg1 = RegisterToIndex(m_arg1.m_label); code.m_type3.m_imm3 = 0; }
void dCILInstrConditional::EmitOpcode(dVirtualMachine::dOpCode* const codeOutPtr) const { dVirtualMachine::dOpCode& code = codeOutPtr[m_byteCodeOffset]; code.m_type2.m_opcode = m_mode == m_ifnot ? unsigned(dVirtualMachine::m_bneq) : unsigned(dVirtualMachine::m_beq); code.m_type2.m_reg0 = RegisterToIndex(m_arg0.m_label); code.m_type2.m_imm2 = m_tagetNode0->GetInfo()->GetByteCodeOffset() - (m_byteCodeOffset + GetByteCodeSize()); }