x86/emulate: add support for movq xmm,xmm/m64
PATCH 1/1 x86/emulate: add support for movq xmm,xmm/m64
Signed-off-by Mihai Donțu <[email protected]>
--- tools/tests/x86_emulator/test_x86_emulator.c | 23 +++++++++++++++++++++++ xen/arch/x86/x86_emulate/x86_emulate.c | 7 ++++--- 2 files changed, 27 insertions(+), 3 deletions(-)
tools/tests/x86_emulator/test_x86_emulator.c +23 -0
@@ -697,6 +697,29 @@ int main(int argc, char **argv)else printf ("skipped\n" ); +printf ("%-40s" ,"Testing movq %%xmm0, 32(%%eax)..." ); +if ( stack_exec && cpu_has_mmx ) + { +decl_insn (movq_to_mem2); + + asmvolatile ("pcmpgtb %%xmm0, %%xmm0\n" + put_insn(movq_to_mem2, "movq %%xmm0, 32(%%eax)") + :: ); + + *((unsigned long *)res +4 ) =0xbdbdbdbdbdbdbdbd ; +set_insn (movq_to_mem2); + regs.ecx =0 ; + regs.eax = (unsigned long )res; + rc =x86_emulate (&ctxt, &emulops); +if ( rc !=X86EMUL_OKAY || !check_eip (movq_to_mem2) ) + goto fail; +if ( *((unsigned long *)res +4 ) ) + goto fail; +printf ("okay\n" ); + } +else +printf ("skipped\n" ); +printf ("%-40s" ,"Testing movdqu %xmm2,(%ecx)..." );if ( stack_exec && cpu_has_sse2 ) {
xen/arch/x86/x86_emulate/x86_emulate.c +4 -3
@@ -245,7 +245,7 @@ static uint8_t twobyte_table[256] = { ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,/* 0xD0 - 0xDF */ -0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , +0 ,0 ,0 ,0 ,0 ,0 , ImplicitOps|ModRM,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,/* 0xE0 - 0xEF */ 0 ,0 ,0 ,0 ,0 ,0 ,0 , ImplicitOps|ModRM,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , /* 0xF0 - 0xFF */
@@ -4412,6 +4412,7 @@ x86_emulate(case 0x7f :/* movq mm,mm/m64 */ /* {,v}movdq{a,u} xmm,xmm/m128 */ /* vmovdq{a,u} ymm,ymm/m256 */ +case 0xd6 :/* movq xmm,xmm/m64 */ {uint8_t *buf =get_stub (stub);struct fpu_insn_ctxt fic = { .insn_bytes =5 };
@@ -4429,9 +4430,9 @@ x86_emulate(case vex_66:case vex_f3:host_and_vcpu_must_have (sse2); - buf[0 ] =0x66 ;/* movdqa */ + buf[0 ] =0x66 ;/* movq, movdqa */ get_fpu (X86EMUL_FPU_xmm, &fic); - ea.bytes =16 ; + ea.bytes = (b ==0xd6 ?8 :16 );break ;case vex_none:if ( b !=0xe7 )
Signature · 7 lines
2.9.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel