static void _imul_ImmStyle( const xRegisterInt& param1, const SrcType& param2, int imm ) { // for iMul OpSize is allowed to be 16 or 32 bit only. const uint OpSize = param1.GetOperandSize(); pxAssert( OpSize == param2.GetOperandSize() ); pxAssert( OpSize > 1 ); xOpWrite0F( (OpSize == 2) ? 0x66 : 0, is_s8( imm ) ? 0x6b : 0x69, param1, param2 ); if( is_s8( imm ) ) xWrite8( (u8)imm ); else param1.xWriteImm( imm ); }
void xImpl_DwordShift::operator()( const xIndirectVoid& dest, const xRegister16or32& from, u8 shiftcnt ) const { if( shiftcnt != 0 ) xOpWrite0F( (from->GetOperandSize() == 2) ? 0x66 : 0x00, OpcodeBase, from, dest, shiftcnt ); }
void xImpl_DwordShift::operator()( const xRegister16& to, const xRegister16& from, u8 shiftcnt ) const { if( shiftcnt != 0 ) xOpWrite0F( 0x66, OpcodeBase, to, from, shiftcnt ); }
void xImpl_DwordShift::operator()( const xIndirectVoid& dest, const xRegister16or32& from, const xRegisterCL& /* clreg */ ) const { xOpWrite0F( (from->GetOperandSize() == 2) ? 0x66 : 0x00, OpcodeBase + 1, from, dest ); }
void xImpl_Group8::operator()( const xRegister16or32& bitbase, u8 bitoffset ) const { xOpWrite0F( (bitbase->GetOperandSize() == 2) ? 0x66 : 0x00, 0xba, InstType, bitbase, bitoffset ); }
void xImpl_BitScan::operator()( const xRegister16or32or64& to, const xIndirectVoid& sibsrc ) const { xOpWrite0F( to->GetPrefix16(), Opcode, to, sibsrc ); }
void xImpl_BitScan::operator()( const xRegister32& to, const xRegister32& from ) const { xOpWrite0F( Opcode, to, from ); }
void xImpl_Group8::operator()( const xRegister16& bitbase, const xRegister16& bitoffset ) const { xOpWrite0F( 0x66, 0xa3 | (InstType << 3), bitbase, bitoffset ); }
void xImpl_DwordShift::operator()( const xIndirectVoid& dest, const xRegister16or32or64& from, u8 shiftcnt ) const { if( shiftcnt != 0 ) xOpWrite0F( from->GetPrefix16(), OpcodeBase, from, dest, shiftcnt ); }
__emitinline void xOpWrite0F( u16 opcode, int instId, const xIndirectVoid& sib ) { xOpWrite0F( 0, opcode, instId, sib ); }
void xImpl_DwordShift::operator()( const xIndirectVoid& dest, const xRegister16or32or64& from, const xRegisterCL& /* clreg */ ) const { xOpWrite0F( from->GetPrefix16(), OpcodeBase + 1, from, dest ); }
void xImpl_DwordShift::operator()( const xRegister16or32or64& to, const xRegister16or32or64& from, u8 shiftcnt ) const { pxAssert( to->GetOperandSize() == from->GetOperandSize() ); if( shiftcnt != 0 ) xOpWrite0F( from->GetPrefix16(), OpcodeBase, to, from, shiftcnt ); }
void xImpl_DwordShift::operator()( const xRegister16or32or64& to, const xRegister16or32or64& from, const xRegisterCL& /* clreg */ ) const { pxAssert( to->GetOperandSize() == from->GetOperandSize() ); xOpWrite0F( from->GetPrefix16(), OpcodeBase+1, to, from ); }
void xImpl_iMul::operator()( const xRegister16& to, const xRegister16& from ) const { xOpWrite0F( 0x66, 0xaf, to, from ); }
void xImpl_BitScan::operator()( const xRegister16& to, const xRegister16& from ) const { xOpWrite0F( 0x66, Opcode, to, from ); }
void xImpl_iMul::operator()( const xRegister16& to, const xIndirectVoid& src ) const { xOpWrite0F( 0x66, 0xaf, to, src ); }
void xImpl_BitScan::operator()( const xRegister16or32& to, const xIndirectVoid& sibsrc ) const { xOpWrite0F( (to->GetOperandSize() == 2) ? 0x66 : 0x00, Opcode, to, sibsrc ); }
void xImpl_Group8::operator()( const xIndirect16& bitbase, u8 bitoffset ) const { xOpWrite0F( 0x66, 0xba, InstType, bitbase, bitoffset ); }
void xImpl_DwordShift::operator()( const xRegister16& to, const xRegister16& from, const xRegisterCL& /* clreg */ ) const { xOpWrite0F( 0x66, OpcodeBase+1, to, from ); }
void xImpl_Group8::operator()( const xIndirectVoid& bitbase, const xRegister16or32& bitoffset ) const { xOpWrite0F( (bitoffset->GetOperandSize() == 2) ? 0x66 : 0x00, 0xa3 | (InstType << 3), bitoffset, bitbase ); }
void xImpl_BitScan::operator()( const xRegister16or32or64& to, const xRegister16or32or64& from ) const { pxAssert( to->GetOperandSize() == from->GetOperandSize() ); xOpWrite0F( from->GetPrefix16(), Opcode, to, from ); }