[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/22] target/i386: split cpu_set_mxcsr() and make c
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 18/22] target/i386: split cpu_set_mxcsr() and make cpu_set_fpuc() inline |
Date: |
Mon, 3 Jul 2017 18:34:49 +0200 |
From: Yang Zhong <address@hidden>
Split the cpu_set_mxcsr() and make cpu_set_fpuc() inline with specific
tcg code.
Signed-off-by: Yang Zhong <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/cpu.h | 18 ++++++++++++++++--
target/i386/fpu_helper.c | 11 ++---------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 8b3b535..67a6091 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1643,8 +1643,22 @@ static inline int32_t x86_get_a20_mask(CPUX86State *env)
}
/* fpu_helper.c */
-void cpu_set_mxcsr(CPUX86State *env, uint32_t val);
-void cpu_set_fpuc(CPUX86State *env, uint16_t val);
+void tcg_update_mxcsr(CPUX86State *env);
+static inline void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr)
+{
+ env->mxcsr = mxcsr;
+ if (tcg_enabled()) {
+ tcg_update_mxcsr(env);
+ }
+}
+
+static inline void cpu_set_fpuc(CPUX86State *env, uint16_t fpuc)
+{
+ env->fpuc = fpuc;
+ if (tcg_enabled()) {
+ update_fp_status(env);
+ }
+}
/* mem_helper.c */
void helper_lock_init(void);
diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c
index 34fb5fc..f0facb9 100644
--- a/target/i386/fpu_helper.c
+++ b/target/i386/fpu_helper.c
@@ -1550,12 +1550,11 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx,
uint64_t mask)
#define SSE_RC_CHOP 0x6000
#define SSE_FZ 0x8000
-void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr)
+void tcg_update_mxcsr(CPUX86State *env)
{
+ uint32_t mxcsr = env->mxcsr;
int rnd_type;
- env->mxcsr = mxcsr;
-
/* set rounding mode */
switch (mxcsr & SSE_RC_MASK) {
default:
@@ -1581,12 +1580,6 @@ void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr)
set_flush_to_zero((mxcsr & SSE_FZ) ? 1 : 0, &env->fp_status);
}
-void cpu_set_fpuc(CPUX86State *env, uint16_t val)
-{
- env->fpuc = val;
- update_fp_status(env);
-}
-
void helper_ldmxcsr(CPUX86State *env, uint32_t val)
{
cpu_set_mxcsr(env, val);
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 14/22] tcg: add CONFIG_TCG guards in headers, (continued)
- [Qemu-devel] [PATCH 13/22] exec: elide calls to tb_lock and tb_unlock, Paolo Bonzini, 2017/07/03
- [Qemu-devel] [PATCH 15/22] tcg: add the CONFIG_TCG into Makefiles, Paolo Bonzini, 2017/07/03
- [Qemu-devel] [PATCH 16/22] target/i386: move cpu_sync_bndcs_hflags() function, Paolo Bonzini, 2017/07/03
- [Qemu-devel] [PATCH 17/22] target/i386: make cpu_get_fp80()/cpu_set_fp80() static, Paolo Bonzini, 2017/07/03
- [Qemu-devel] [PATCH 18/22] target/i386: split cpu_set_mxcsr() and make cpu_set_fpuc() inline,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 22/22] configure: warn on untested --disable-tcg, Paolo Bonzini, 2017/07/03
- [Qemu-devel] [PATCH 21/22] target/i386: add the CONFIG_TCG into Makefiles, Paolo Bonzini, 2017/07/03
- [Qemu-devel] [PATCH 19/22] target/i386: move TLB refill function out of helper.c, Paolo Bonzini, 2017/07/03
- [Qemu-devel] [PATCH 20/22] target/i386: add the tcg_enabled() in target/i386/, Paolo Bonzini, 2017/07/03