mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
x86emit: fix REX order with all SSE prefixes (nw)
This commit is contained in:
parent
b2578a2283
commit
3af8030bb6
@ -1273,6 +1273,11 @@ inline void emit_op(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8
|
||||
if (opsize == OP_16BIT)
|
||||
emit_byte(emitptr, PREFIX_OPSIZE);
|
||||
|
||||
bool has_prefix = (op & 0xff0000) == 0x660000 || (op & 0xff0000) == 0xf20000 || (op & 0xff0000) == 0xf30000;
|
||||
|
||||
if (has_prefix)
|
||||
emit_byte(emitptr, op >> 16);
|
||||
|
||||
#if (X86EMIT_SIZE == 64)
|
||||
{
|
||||
UINT8 rex;
|
||||
@ -1287,7 +1292,7 @@ inline void emit_op(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8
|
||||
assert(opsize != OP_64BIT);
|
||||
#endif
|
||||
|
||||
if ((op & 0xff0000) != 0)
|
||||
if ((op & 0xff0000) != 0 && !has_prefix)
|
||||
emit_byte(emitptr, op >> 16);
|
||||
if ((op & 0xff00) != 0)
|
||||
emit_byte(emitptr, op >> 8);
|
||||
@ -2936,10 +2941,10 @@ inline void emit_movd_m32_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg)
|
||||
|
||||
#if (X86EMIT_SIZE == 64)
|
||||
|
||||
inline void emit_movq_r128_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_byte(emitptr, 0x66); emit_op_modrm_reg(emitptr, OP_MOVD_Pd_Ed, OP_64BIT, dreg, sreg); }
|
||||
inline void emit_movq_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_byte(emitptr, 0x66); emit_op_modrm_mem(emitptr, OP_MOVD_Pd_Ed, OP_64BIT, dreg, memref); }
|
||||
inline void emit_movq_r64_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_byte(emitptr, 0x66); emit_op_modrm_reg(emitptr, OP_MOVD_Ed_Pd, OP_64BIT, sreg, dreg); }
|
||||
inline void emit_movq_m64_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_byte(emitptr, 0x66); emit_op_modrm_mem(emitptr, OP_MOVD_Ed_Pd, OP_64BIT, sreg, memref); }
|
||||
inline void emit_movq_r128_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Vd_Ed, OP_64BIT, dreg, sreg); }
|
||||
inline void emit_movq_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVD_Vd_Ed, OP_64BIT, dreg, memref); }
|
||||
inline void emit_movq_r64_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Ed_Vd, OP_64BIT, sreg, dreg); }
|
||||
inline void emit_movq_m64_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVD_Ed_Vd, OP_64BIT, sreg, memref); }
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user