x64Emitter: add BMI1/BMI2 support

TZCNT and LZCNT use a completely different encoding scheme, so they should
probably go in a separate patch.
Yeah, several ternary expressions on the same line is really difficult to
parse. Please rewrite that.


On Mon, Aug 25, 2014 at 12:52 PM, Tillmann Karras <notifications@github.com>
wrote:

> In Source/Core/Common/x64Emitter.cpp:
>
> >  	Write8(sseOp & 0xFF);
> >  	arg.WriteRest(this, extrabytes, regOp1);
> >  }
> >
> > +// Like the above, but more general; covers GPR-based VEX operations, like BMI1/2
> > +void XEmitter::WriteVEXOp(int size, u8 opPrefix, u16 op, X64Reg regOp1, X64Reg regOp2, OpArg arg, int extrabytes)
> > +{
> > +	if (size != 32 && size != 64)
> > +		PanicAlert("VEX GPR instructions only support 32-bit and 64-bit modes!");
> > +	int mmmmm = (op >> 8) == 0x3A ? 3 : (op >> 8) == 0x38 ? 2 : 1;
> > +	int pp = opPrefix == 0x66 ? 1 : opPrefix == 0xF3 ? 2 : opPrefix == 0xF2 ? 3 : 0;
>
> Maybe transform these two lines into switch statements? I don't know, it
> might look totally bloated...
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dolphin-emu/dolphin/pull/868/files#r16649996>.
>



-- 
Pierre "delroth" Bourdon <delroth@gmail.com>
Software Engineer @ Zürich, Switzerland
http://code.delroth.net/