summaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-25 23:19:55 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-25 23:19:55 +0000
commit97eb5b14dcfad346fa79e95e0e020aced9973311 (patch)
tree8dfb51754bd17436c0c2f1a0edba843ea76c89c2 /cpu-exec.c
parent7eee2a509a9a777aafd0c2efb14b837b83a8df9c (diff)
downloadqemu-97eb5b14dcfad346fa79e95e0e020aced9973311.tar.gz
native FPU support in code copy mode
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@643 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 44a0f73a58..c6f52f2780 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -380,6 +380,11 @@ int cpu_exec(CPUState *env1)
) {
spin_lock(&tb_lock);
tb_add_jump((TranslationBlock *)(T0 & ~3), T0 & 3, tb);
+#if defined(USE_CODE_COPY)
+ /* propagates the FP use info */
+ ((TranslationBlock *)(T0 & ~3))->cflags |=
+ (tb->cflags & CF_FP_USED);
+#endif
spin_unlock(&tb_lock);
}
tc_ptr = tb->tc_ptr;
@@ -402,8 +407,14 @@ int cpu_exec(CPUState *env1)
#elif defined(TARGET_I386) && defined(USE_CODE_COPY)
{
if (!(tb->cflags & CF_CODE_COPY)) {
+ if ((tb->cflags & CF_FP_USED) && env->native_fp_regs) {
+ save_native_fp_state(env);
+ }
gen_func();
} else {
+ if ((tb->cflags & CF_FP_USED) && !env->native_fp_regs) {
+ restore_native_fp_state(env);
+ }
/* we work with native eflags */
CC_SRC = cc_table[CC_OP].compute_all();
CC_OP = CC_OP_EFLAGS;
@@ -487,6 +498,11 @@ int cpu_exec(CPUState *env1)
#if defined(TARGET_I386)
+#if defined(USE_CODE_COPY)
+ if (env->native_fp_regs) {
+ save_native_fp_state(env);
+ }
+#endif
/* restore flags in standard format */
env->eflags = env->eflags | cc_table[CC_OP].compute_all() | (DF & DF_MASK);
@@ -747,7 +763,7 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
struct ucontext *uc = puc;
unsigned long pc;
int trapno;
-
+
#ifndef REG_EIP
/* for glibc 2.1 */
#define REG_EIP EIP