x86emitter: extend lea/bswap

This commit is contained in:
Gregory Hainaut 2016-01-16 23:31:00 +01:00
parent eb4db2152c
commit 4bc9cbc24f
2 changed files with 9 additions and 4 deletions

View File

@ -134,13 +134,14 @@ namespace x86Emitter
// These are all defined inline or in ix86.cpp.
//
extern void xBSWAP( const xRegister32& to );
extern void xBSWAP( const xRegister32or64& to );
// ----- Lea Instructions (Load Effective Address) -----
// Note: alternate (void*) forms of these instructions are not provided since those
// forms are functionally equivalent to Mov reg,imm, and thus better written as MOVs
// instead.
extern void xLEA( xRegister64 to, const xIndirectVoid& src, bool preserve_flags=false );
extern void xLEA( xRegister32 to, const xIndirectVoid& src, bool preserve_flags=false );
extern void xLEA( xRegister16 to, const xIndirectVoid& src, bool preserve_flags=false );

View File

@ -907,11 +907,15 @@ static void EmitLeaMagic( const xRegisterInt& to, const xIndirectVoid& src, bool
}
}
__emitinline void xLEA( xRegister32 to, const xIndirectVoid& src, bool preserve_flags )
__emitinline void xLEA( xRegister64 to, const xIndirectVoid& src, bool preserve_flags )
{
EmitLeaMagic( to, src, preserve_flags );
}
__emitinline void xLEA( xRegister32 to, const xIndirectVoid& src, bool preserve_flags )
{
EmitLeaMagic( to, src, preserve_flags );
}
__emitinline void xLEA( xRegister16 to, const xIndirectVoid& src, bool preserve_flags )
{
@ -1077,10 +1081,10 @@ __fi void xINT( u8 imm )
__fi void xINTO() { xWrite8(0xce); }
__emitinline void xBSWAP( const xRegister32& to )
__emitinline void xBSWAP( const xRegister32or64& to )
{
xWrite8( 0x0F );
xWrite8( 0xC8 | to.Id );
xWrite8( 0xC8 | to->Id );
}
static __aligned16 u64 xmm_data[iREGCNT_XMM*2];