From patchwork Tue Jul 13 16:42:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 474696 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4142382jao; Tue, 13 Jul 2021 09:47:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy59+rPLkjY+cEfo/756iZaerRZqfaRqqAsc/9dLVoxtXk3+RJ06Dzk2juPyb3Jm/GwM9TX X-Received: by 2002:a5d:6b91:: with SMTP id n17mr6946028wrx.385.1626194822366; Tue, 13 Jul 2021 09:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626194822; cv=none; d=google.com; s=arc-20160816; b=xO+ScVfGo64D713Hlzdqw4PGhS3FpKCKsDQ0f0Cof5gFQfbtsfya8Y+E/wXnbPEg0s RRt5y6NQco6VOZx4UIM+gianGvj0up5McTZtSaNbR5BfSmqaBZrDJNEov41G8G3LdQkW 5VJsC9mSwNEEAt08mJuM7jqK0kQ1q8XMrly3wg/DJ46TCjsP7y95IxTxtkm5aCyjjh4U mbuCccoSF+LNrItFGbIn9YghUottvonBLTESm9EGK3ArdaZZvyFw5lZFq2iXYNzLckhD dyk8cd6xpO97fOJ7LA233NWHFwGDoAgtmaiAubWlVjxOK0JJEGDH1iWcUL3p7wJVVBgW rJUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cYyCuRRmAK2Rie5jBdr3R+LAqWVke2VP4TG50eB3qqU=; b=lmUYhrv77l2bDlDPzRpgiYlOSKl5b5Y7DDJi6l1ApQTstcugdW3XjKGHgY0OQ5UIHI CnkhsXB4GHmRq0SWqrCIskzK293qTRoAX0e5Cku/u6IiQjj0KUkGDCT07pZO51rpxXFb OTc+kjpCbo0HcVH1iJfbZni1wSqVt42F+C0dypu417ByZ8H9uIY71u2gz7clFGmk3IXu E++/jawUt8f9KNxREZ2FJMjRZAG4woB3xNNgiwO+s2WYlpkEIo1sJTgA1Vd+HqRLewr5 KkRTKzmt2+fRCvg4hC8P9aMgXkx5QklaR5jNzFUWVyWj1i+NxOQMDksFdyF6w58thsi0 im5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZBiGSyRc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l20si4608986wmg.3.2021.07.13.09.47.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jul 2021 09:47:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZBiGSyRc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3LYi-0000fY-B1 for patch@linaro.org; Tue, 13 Jul 2021 12:47:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3LUB-0006qy-HE for qemu-devel@nongnu.org; Tue, 13 Jul 2021 12:42:19 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:35756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3LU7-0005da-Nc for qemu-devel@nongnu.org; Tue, 13 Jul 2021 12:42:19 -0400 Received: by mail-pj1-x102c.google.com with SMTP id h1-20020a17090a3d01b0290172d33bb8bcso1827483pjc.0 for ; Tue, 13 Jul 2021 09:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cYyCuRRmAK2Rie5jBdr3R+LAqWVke2VP4TG50eB3qqU=; b=ZBiGSyRcGFJCvpFrQwW2Xizu7CILQqueQQylkF+YeKs4PT0ZPSbsRQYNKWmZjdgNwL NlhI0pE555NlsQ/dV/eKeTQfHz6g4Vay+Tf1qz92r1t4VN1mltKi+SygKuiHIp21rNNv prY1DwEYBC8JkK6Na/3T9fVR6HoQ0geP9uUHAcHdG9B0HommMkDkU6+g46Gh/Sd2QW3y Wy3YzScJACqS4jq/KYZ2oOLllcqozYGaE45sHVQGxy3qfklZg0Jr5ssIB9kM0O8Opv0m pEZ6p/k0VnLCR+pzADq6uM/K8DBqHbmjhrYKjcDwKDJwwll9kLLjns/Rn5UdN52hnBrd Vhyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cYyCuRRmAK2Rie5jBdr3R+LAqWVke2VP4TG50eB3qqU=; b=B+5FXDUv4dv2CBqByroZhGG6lnQW3cmBEF5U+FgMr1tlQF8Gd5B6erO7/GjPhTRscG R2oSZeQB0y7qOCPHQqr4zs0wGEVM8o3FwnyqFJjW84/dBghCSNWeE/WuQs+3yCAcVkKZ zTZ+eir1R5t9fRi4Rg/ZhKFxMDU/3Mu8JhiPR4BU5/nD/ai2CDPlhLHx2ZWAndqxEnbz pu3JXDSNQBbxLv+u2mpkdXxEqhA45BsaEyoVTY7UMQ83qPvHQ4GAL+i4Vz4awx2pcn/5 KmV/3toqbOfGvJhrGRlEUaoSdnM9YhHuXS8xbgoKDzMAD0B5YJ2xD9dqvRnpIcWriU0C yGEA== X-Gm-Message-State: AOAM531bQGKt1K+nimLZxuUrkTtaTH0PIafJ6tqsCTS6D0WNwDzHPKWL aumqQ1mu/z7KaVnljAvbBloLVPS7wYh/0g== X-Received: by 2002:a17:90b:3a89:: with SMTP id om9mr2828110pjb.91.1626194534269; Tue, 13 Jul 2021 09:42:14 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id z13sm4947865pfn.94.2021.07.13.09.42.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 09:42:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/14] target/i386: Split out do_fninit Date: Tue, 13 Jul 2021 09:42:00 -0700 Message-Id: <20210713164211.1520109-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210713164211.1520109-1-richard.henderson@linaro.org> References: <20210713164211.1520109-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not call helper_fninit directly from helper_xrstor. Do call the new helper from do_fsave. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) -- 2.25.1 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)); } }