qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yang Zhong <yang.zhong@intel.com>
To: pbonzini@redhat.com, rth@twiddle.net, thuth@redhat.com
Cc: qemu-devel@nongnu.org, anthony.xu@intel.com,
	a.rigo@virtualopensystems.com, yang.zhong@intel.com
Subject: [Qemu-devel] [PATCH v2 11/15] tcg: split cpu_set_mxcsr() and make cpu_set_fpuc() inline
Date: Mon,  3 Jul 2017 18:12:19 +0800	[thread overview]
Message-ID: <1499076743-15477-12-git-send-email-yang.zhong@intel.com> (raw)
In-Reply-To: <1499076743-15477-1-git-send-email-yang.zhong@intel.com>

Split the cpu_set_mxcsr() and make cpu_set_fpuc() inline with specific
tcg code.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 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.9.1

  parent reply	other threads:[~2017-07-03 10:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 10:12 [Qemu-devel] [PATCH v2 00/15] add disable-tcg option for x86 build Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option Yang Zhong
2017-07-03 10:20   ` Daniel P. Berrange
2017-07-03 10:25     ` Paolo Bonzini
2017-07-03 10:33       ` Daniel P. Berrange
2017-07-03 10:55         ` Paolo Bonzini
2017-07-03 11:40           ` Thomas Huth
2017-07-03 12:09           ` Daniel P. Berrange
2017-07-03 12:55             ` Paolo Bonzini
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 02/15] vl: add tcg_enabled() for tcg related code Yang Zhong
2017-07-03 12:30   ` Thomas Huth
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 03/15] tcg: tcg_handle_interrupt() function Yang Zhong
2017-07-03 12:35   ` Thomas Huth
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 04/15] tcg: change tcg_enabled() Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 05/15] tcg: move page_size_init() function Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 06/15] kvmvapic: remove tcg related code Yang Zhong
2017-07-03 14:28   ` Paolo Bonzini
2017-07-04  2:46     ` Zhong Yang
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 07/15] tcg: move cpu_sync_bndcs_hflags() function Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 08/15] tcg: make cpu_get_fp80()/cpu_set_fp80() static Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 09/15] tcg: add the tcg-stub.c file into accel/stubs/ Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 10/15] tcg: move tb related lock functions Yang Zhong
2017-07-03 10:12 ` Yang Zhong [this message]
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 12/15] tcg: disable tcg in CPUX86State struct Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 13/15] tcg: add the CONFIG_TCG for header Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 14/15] tcg: add the tcg_enabled() in target/i386/ Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 15/15] tcg: add the CONFIG_TCG into Makefiles Yang Zhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499076743-15477-12-git-send-email-yang.zhong@intel.com \
    --to=yang.zhong@intel.com \
    --cc=a.rigo@virtualopensystems.com \
    --cc=anthony.xu@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).