From nobody Mon Feb 9 12:14:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149910075465476.06260011737186; Mon, 3 Jul 2017 09:52:34 -0700 (PDT) Received: from localhost ([::1]:36352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4aP-0006pT-Dn for importer@patchew.org; Mon, 03 Jul 2017 12:52:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KW-0000xe-SR for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KW-0008Dl-4b for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:08 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KV-0008Cy-Uf for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:08 -0400 Received: by mail-wm0-x243.google.com with SMTP id u23so21543406wma.2 for ; Mon, 03 Jul 2017 09:36:07 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id r5sm4867459wmr.9.2017.07.03.09.36.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=WCiG1q4FT5mLtXw9L8wYE0HKhy6V2ZNVSRomxCX8tBg=; b=WTadG+c1wtpGygh3lkgweJB6hB+0waz1DcnlGlnA2xuAtRRsOYD7NCbmwXa65IeBMp 9bp364b5n70V2BZ3oBsg0Lbzyd5Pw8Loex1UTzXvEay4BnnUV7CMB77aA4FMBZrpr8Zd roWDu0C/pBp06qGWR44IRzxtUwUD+mwMRRE4hk2Y1lHHpp4bwIGhhAXgWByqsLN3HcF7 lFTfLcpZuePmFWgUZ9Jowb13W+fXtjiwAEuLqaXq7VjmkEfedoPCJywlubs4YWwiu6mX UjWuduqx0hfRSgt0vpyeWVyHz41DLf24Vn/UG7gY/npG0E/TA4IYzASA11tvYQ7x7uew aXKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=WCiG1q4FT5mLtXw9L8wYE0HKhy6V2ZNVSRomxCX8tBg=; b=IMKPDwKo9n0B3nO2b1zfRhMaLHqW4q3xjWYvs2ZJlKoiK1ytdyDutpWFWaxXzgRIXi f5gtH5HYwSaXMBNreTvwPVYsl55L2RE4Nyv44W8dRQT7uzxkccM5EWvFWSg9uL2AZkbF 6spAAifsHwAjpQK1NwEUnyoMd6HpWjn0s+NH0eV1MopCHyt+xcJvPvdWycI9U7kThh2X 8w3KgyY1Ye1q2t+3eOtOcN+ogF2xG8Mt0ZwZ7sHDFTC/z5tR691/5SZ/OoRTkzetBs5x O6obFoekfbYkGjXxnRVvJPSsL4HeQKTZgKXgT3pVeTwOhRYdblgQVVq9GkveGcBgt9DM /Q6Q== X-Gm-Message-State: AIVw111+Qg2abQ37ZbUH6LVtdKiJAFSQu0ppSkbuyo401gDnTIGnth2g O6bATxbNywaSOrVH5xI= X-Received: by 10.28.52.133 with SMTP id b127mr3442007wma.2.1499099766721; Mon, 03 Jul 2017 09:36:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:49 +0200 Message-Id: <1499099693-22903-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 18/22] target/i386: split cpu_set_mxcsr() and make cpu_set_fpuc() inline X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.zhong@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Split the cpu_set_mxcsr() and make cpu_set_fpuc() inline with specific tcg code. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- 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) } =20 /* 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 =3D mxcsr; + if (tcg_enabled()) { + tcg_update_mxcsr(env); + } +} + +static inline void cpu_set_fpuc(CPUX86State *env, uint16_t fpuc) +{ + env->fpuc =3D fpuc; + if (tcg_enabled()) { + update_fp_status(env); + } +} =20 /* 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 =20 -void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) +void tcg_update_mxcsr(CPUX86State *env) { + uint32_t mxcsr =3D env->mxcsr; int rnd_type; =20 - env->mxcsr =3D 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); } =20 -void cpu_set_fpuc(CPUX86State *env, uint16_t val) -{ - env->fpuc =3D val; - update_fp_status(env); -} - void helper_ldmxcsr(CPUX86State *env, uint32_t val) { cpu_set_mxcsr(env, val); --=20 1.8.3.1