From 6aa2b73bea09aeff7e65efa9bd18ca51f84859e8 Mon Sep 17 00:00:00 2001 From: mothran Date: Sun, 30 Aug 2015 19:39:46 -0700 Subject: [PATCH] removed ifdef for x64 in fpu saving --- qemu/target-i386/fpu_helper.c | 43 ++++++++++++++++------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/qemu/target-i386/fpu_helper.c b/qemu/target-i386/fpu_helper.c index e9cbd7d0..a74380f0 100644 --- a/qemu/target-i386/fpu_helper.c +++ b/qemu/target-i386/fpu_helper.c @@ -986,7 +986,7 @@ void helper_fstenv(CPUX86State *env, target_ulong ptr, int data32) } } } -#ifdef TARGET_X86_64 + // DFLAG enum: tcg.h, case here to int if (env->hflags & HF_CS64_MASK) { cpu_stl_data(env, ptr, env->fpuc); @@ -996,29 +996,24 @@ void helper_fstenv(CPUX86State *env, target_ulong ptr, int data32) cpu_stl_data(env, ptr + 20, 0); /* fpcs */ cpu_stl_data(env, ptr + 24, 0); /* fpoo */ cpu_stl_data(env, ptr + 28, 0); /* fpos */ - } -#endif - if (!(env->hflags & HF_CS64_MASK)) - { - if (data32) { - /* 32 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 + 16, 0); /* fpcs */ - cpu_stl_data(env, ptr + 20, 0); /* fpoo */ - cpu_stl_data(env, ptr + 24, 0); /* fpos */ - } 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, env->fpip); - cpu_stw_data(env, ptr + 8, 0); - cpu_stw_data(env, ptr + 10, 0); - cpu_stw_data(env, ptr + 12, 0); - } + } else if (data32) { + /* 32 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 + 16, 0); /* fpcs */ + cpu_stl_data(env, ptr + 20, 0); /* fpoo */ + cpu_stl_data(env, ptr + 24, 0); /* fpos */ + } 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, env->fpip); + cpu_stw_data(env, ptr + 8, 0); + cpu_stw_data(env, ptr + 10, 0); + cpu_stw_data(env, ptr + 12, 0); } }