[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/14] target/i386: Split out do_fninit
From: |
Richard Henderson |
Subject: |
[PULL 03/14] target/i386: Split out do_fninit |
Date: |
Tue, 13 Jul 2021 09:42:00 -0700 |
Do not call helper_fninit directly from helper_xrstor.
Do call the new helper from do_fsave.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/tcg/fpu_helper.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c
index 74bbe94b80..beb63be432 100644
--- a/target/i386/tcg/fpu_helper.c
+++ b/target/i386/tcg/fpu_helper.c
@@ -727,7 +727,7 @@ void helper_fwait(CPUX86State *env)
}
}
-void helper_fninit(CPUX86State *env)
+static void do_fninit(CPUX86State *env)
{
env->fpus = 0;
env->fpstt = 0;
@@ -742,6 +742,11 @@ void helper_fninit(CPUX86State *env)
env->fptags[7] = 1;
}
+void helper_fninit(CPUX86State *env)
+{
+ do_fninit(env);
+}
+
/* BCD ops */
void helper_fbld_ST0(CPUX86State *env, target_ulong ptr)
@@ -2451,18 +2456,7 @@ static void do_fsave(CPUX86State *env, target_ulong ptr,
int data32,
ptr += 10;
}
- /* fninit */
- env->fpus = 0;
- env->fpstt = 0;
- cpu_set_fpuc(env, 0x37f);
- env->fptags[0] = 1;
- env->fptags[1] = 1;
- env->fptags[2] = 1;
- env->fptags[3] = 1;
- env->fptags[4] = 1;
- env->fptags[5] = 1;
- env->fptags[6] = 1;
- env->fptags[7] = 1;
+ do_fninit(env);
}
void helper_fsave(CPUX86State *env, target_ulong ptr, int data32)
@@ -2834,7 +2828,7 @@ void helper_xrstor(CPUX86State *env, target_ulong ptr,
uint64_t rfbm)
if (xstate_bv & XSTATE_FP_MASK) {
do_xrstor_fpu(env, ptr, ra);
} else {
- helper_fninit(env);
+ do_fninit(env);
memset(env->fpregs, 0, sizeof(env->fpregs));
}
}
--
2.25.1
- [PULL 00/14] misc translator patch queue, Richard Henderson, 2021/07/13
- [PULL 01/14] target/i386: Tidy hw_breakpoint_remove, Richard Henderson, 2021/07/13
- [PULL 03/14] target/i386: Split out do_fninit,
Richard Henderson <=
- [PULL 02/14] target/i386: Trivial code motion and code style fix, Richard Henderson, 2021/07/13
- [PULL 05/14] target/alpha: Store set into rx flag, Richard Henderson, 2021/07/13
- [PULL 06/14] target/alpha: Use dest_sink for HW_RET temporary, Richard Henderson, 2021/07/13
- [PULL 04/14] target/i386: Correct implementation for FCS, FIP, FDS and FDP, Richard Henderson, 2021/07/13
- [PULL 07/14] target/alpha: Use tcg_constant_i64 for zero and lit, Richard Henderson, 2021/07/13
- [PULL 11/14] target/openrisc: Cache constant 0 in DisasContext, Richard Henderson, 2021/07/13
- [PULL 08/14] target/alpha: Use tcg_constant_* elsewhere, Richard Henderson, 2021/07/13
- [PULL 10/14] target/openrisc: Use tcg_constant_tl for dc->R0, Richard Henderson, 2021/07/13
- [PULL 09/14] target/openrisc: Use tcg_constant_*, Richard Henderson, 2021/07/13
- [PULL 12/14] target/openrisc: Use dc->zero in gen_add, gen_addc, Richard Henderson, 2021/07/13