From 912faf2c3cb9c47977d115cdcd893d0894703946 Mon Sep 17 00:00:00 2001 From: mothran Date: Sun, 30 Aug 2015 18:04:28 -0700 Subject: [PATCH] after closer review, in x64 the the op size is 32 so data32 is set, can removed the unicorn dependency and regress/fpu_ip64.py still works --- qemu/target-i386/fpu_helper.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/qemu/target-i386/fpu_helper.c b/qemu/target-i386/fpu_helper.c index a54580c8..ea0c1fca 100644 --- a/qemu/target-i386/fpu_helper.c +++ b/qemu/target-i386/fpu_helper.c @@ -986,18 +986,7 @@ void helper_fstenv(CPUX86State *env, target_ulong ptr, int data32) } } } - switch (env->uc->mode) { - case (UC_MODE_64): - /* 64 bit */ - cpu_stl_data(env, ptr, env->fpuc); - cpu_stl_data(env, ptr + 4, fpus); - cpu_stl_data(env, ptr + 8, fptag); - cpu_stl_data(env, ptr + 12, env->fpip); /* fpip */ - cpu_stl_data(env, ptr + 20, 0); /* fpcs */ - cpu_stl_data(env, ptr + 24, 0); /* fpoo */ - cpu_stl_data(env, ptr + 28, 0); /* fpos */ - break; - case (UC_MODE_32): + if (data32) { /* 32 bit */ cpu_stl_data(env, ptr, env->fpuc); cpu_stl_data(env, ptr + 4, fpus); @@ -1006,19 +995,15 @@ void helper_fstenv(CPUX86State *env, target_ulong ptr, int data32) cpu_stl_data(env, ptr + 16, 0); /* fpcs */ cpu_stl_data(env, ptr + 20, 0); /* fpoo */ cpu_stl_data(env, ptr + 24, 0); /* fpos */ - break; - case (UC_MODE_16): + } else { /* 16 bit */ cpu_stw_data(env, ptr, env->fpuc); cpu_stw_data(env, ptr + 2, fpus); cpu_stw_data(env, ptr + 4, fptag); - cpu_stw_data(env, ptr + 6, 0); + cpu_stw_data(env, ptr + 6, env->fpip); cpu_stw_data(env, ptr + 8, 0); cpu_stw_data(env, ptr + 10, 0); cpu_stw_data(env, ptr + 12, 0); - break; - default: - break; } }