@@ -650,6 +650,48 @@ int main(int argc, char **argv)
#define check_eip(which) (regs.eip == (unsigned long)instr + \
(unsigned long)which##_len)
+ printf("%-40s", "Testing movd %%mm3,32(%%eax)...");
+ if ( stack_exec && cpu_has_mmx )
+ {
+ decl_insn(movd_to_mem32);
+
+ asm volatile ( "pcmpeqb %%mm3, %%mm3\n"
+ put_insn(movd_to_mem32, "movd %%mm3, 32(%%eax)")
+ :: );
+
+ *(res + 8) = 0xbdbdbdbd;
+ set_insn(movd_to_mem32);
+ regs.eax = (unsigned long)res;
+ rc = x86_emulate(&ctxt, &emulops);
+ if ( (rc != X86EMUL_OKAY) || *(res + 8) != 0xffffffff ||
+ !check_eip(movd_to_mem32) )
+ goto fail;
+ printf("okay\n");
+ }
+ else
+ printf("skipped\n");
+
+ printf("%-40s", "Testing vmovd %%xmm1,32(%%eax)...");
+ if ( stack_exec && cpu_has_avx )
+ {
+ decl_insn(vmovd_to_mem32);
+
+ asm volatile ( "pcmpeqb %%xmm1, %%xmm1\n"
+ put_insn(vmovd_to_mem32, "vmovd %%xmm1, 32(%%eax)")
+ :: );
+
+ *(res + 8) = 0xbdbdbdbd;
+ set_insn(vmovd_to_mem32);
+ regs.eax = (unsigned long)res;
+ rc = x86_emulate(&ctxt, &emulops);
+ if ( (rc != X86EMUL_OKAY) || *(res + 8) != 0xffffffff ||
+ !check_eip(vmovd_to_mem32) )
+ goto fail;
+ printf("okay\n");
+ }
+ else
+ printf("skipped\n");
+
printf("%-40s", "Testing movq %mm3,(%ecx)...");
if ( stack_exec && cpu_has_mmx )
{
Signed-off-by: Mihai Donțu <mdontu@bitdefender.com> --- tools/tests/x86_emulator/test_x86_emulator.c | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)