From nobody Mon Nov 25 10:22:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1716771257; cv=none; d=zohomail.com; s=zohoarc; b=I0t6t4dbHBkhCtPXc1gSdzLrFbyLuD4BAUHVbxcu7JG4CYughLfXhBvcw+jau9+TqNRyHfcELKaWCmS4gxupqaE1KtnSMiRwiTPQuo1xABTzyKK79b3LuKmvMsqXlYRWBqwE3SOPL58gqoJP3VQW2AiGdFEvX+Qjpb8P55lqgns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716771257; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pTjFqZGfIgyyuZashU0miJrDlkwdhgdcBxd/4Tmn0sc=; b=RxhP+00ZlCbwo7MaG4QFXM3PCFkLD0YhiQZEC9MegspH/8NUDDBHCcZLJD98BCmEFokdNXu76vdDykbLnjGhEcYcDnDmtg5vZDGN7bET4/fdzl6KmF152ToE3anqQ/HkWeDFsquHkfPuetDpObZSSlcJPlJrMW+NXbnYzHMA7fY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716771257390979.3692089172526; Sun, 26 May 2024 17:54:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBOZL-0007GS-Mu; Sun, 26 May 2024 20:50:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBOZ8-000775-S3 for qemu-devel@nongnu.org; Sun, 26 May 2024 20:50:18 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBOZ2-0003a2-Tb for qemu-devel@nongnu.org; Sun, 26 May 2024 20:50:18 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6fbbd937719so1507274b3a.0 for ; Sun, 26 May 2024 17:50:07 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fd6d7598sm3942958b3a.220.2024.05.26.17.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 17:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716771006; x=1717375806; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pTjFqZGfIgyyuZashU0miJrDlkwdhgdcBxd/4Tmn0sc=; b=DFfQv3ULFmGnf3HpQd7rFKZEXnkEE4BCJ1cp0knxse7w4IImx2KqRVT/pw6tbGiF9P 1lm/seR62w2ZwDD2PP2+c6AEiSISJS0oGewVLlNxYzxRb0dRi4o0AWK4KDkts/shBW7y zOtyTiCtprm9N1GYaXsud9B+s6tDiQ5z7BgHCyKqEDIgxnUT7nnSQ1ZgTecTpNaN7bzm 4QdU6Wu6FiNKXj5WM3DCpkjnwd9L3AYT3tOH6+Zxg9iro1PYQEy63GcWtvTlfc2OUpAe n2o94DIHKsqGFBQBIvm1cNwFrNQ6eHEhAXXS2TF0AchHTrFzB1x0iVUM2didqxUd3wBW kzdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716771006; x=1717375806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pTjFqZGfIgyyuZashU0miJrDlkwdhgdcBxd/4Tmn0sc=; b=uLAOH6mO+f8TJX93rKQelSJptlGzp8q5+rW5OwiXeHReG8CNRuGhEABrhwTaxBYRc2 pc+JCc/7zTV/xEgsdqsv0IGSuKkGS3hLR5J/+TCOkorCTGb+sMwzd9eoDo/elvc+rUU9 WBtQNzQ1qdhZnDLMCaiJFbcH4AfqAWjO6oRl2CEAq40Uvtw+tG7A4h+BHFo5kno7mnO/ WBDXp1oAc79EC1HEJlHlL9iatYk9jYtgzsU7omJenSq/aJ2eexyu74H4JHlLNwlzj/pq DpIRR3rXrQ3186hp4qJMrVwNMgd1Oi0wa9XKkHEUIy71ZYrNuHHKLfDrmsYEIlmAj/Q3 9XmQ== X-Gm-Message-State: AOJu0YyGnLo490BnTAV/taxH/ufl4r1fusjWDJzTavGebeV+vfrVZSCx z9I8qTU2BsS5CvPN+2Wm3GLYD516Yu2SggapPqcSB0aeZ+mjTikv8NhuG3Ghop6pSkMt+MJJAxe H X-Google-Smtp-Source: AGHT+IGUYZRA98XHUQt/DK6uWp1kMV5tUH2iUJ1PLkd7UxR8Kb56BA/CjzfWk7WCMavXfBsffrRkoA== X-Received: by 2002:a05:6a00:808c:b0:6f4:5531:7ce4 with SMTP id d2e1a72fcca58-6f8f41b2d8fmr8568683b3a.33.1716771006316; Sun, 26 May 2024 17:50:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Paolo Bonzini Subject: [PULL 05/28] target/i386: Convert do_fstenv to X86Access Date: Sun, 26 May 2024 17:49:38 -0700 Message-Id: <20240527005001.642825-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527005001.642825-1-richard.henderson@linaro.org> References: <20240527005001.642825-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1716771258117100001 Content-Type: text/plain; charset="utf-8" Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 45 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 5ad6e04639..01e9a1fbbf 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -2373,9 +2373,9 @@ void helper_fxam_ST0(CPUX86State *env) } } =20 -static void do_fstenv(CPUX86State *env, target_ulong ptr, int data32, - uintptr_t retaddr) +static void do_fstenv(X86Access *ac, target_ulong ptr, int data32) { + CPUX86State *env =3D ac->env; int fpus, fptag, exp, i; uint64_t mant; CPU_LDoubleU tmp; @@ -2402,28 +2402,31 @@ static void do_fstenv(CPUX86State *env, target_ulon= g ptr, int data32, } if (data32) { /* 32 bit */ - cpu_stl_data_ra(env, ptr, env->fpuc, retaddr); - cpu_stl_data_ra(env, ptr + 4, fpus, retaddr); - cpu_stl_data_ra(env, ptr + 8, fptag, retaddr); - cpu_stl_data_ra(env, ptr + 12, env->fpip, retaddr); /* fpip */ - cpu_stl_data_ra(env, ptr + 16, env->fpcs, retaddr); /* fpcs */ - cpu_stl_data_ra(env, ptr + 20, env->fpdp, retaddr); /* fpoo */ - cpu_stl_data_ra(env, ptr + 24, env->fpds, retaddr); /* fpos */ + access_stl(ac, ptr, env->fpuc); + access_stl(ac, ptr + 4, fpus); + access_stl(ac, ptr + 8, fptag); + access_stl(ac, ptr + 12, env->fpip); /* fpip */ + access_stl(ac, ptr + 16, env->fpcs); /* fpcs */ + access_stl(ac, ptr + 20, env->fpdp); /* fpoo */ + access_stl(ac, ptr + 24, env->fpds); /* fpos */ } else { /* 16 bit */ - cpu_stw_data_ra(env, ptr, env->fpuc, retaddr); - cpu_stw_data_ra(env, ptr + 2, fpus, retaddr); - cpu_stw_data_ra(env, ptr + 4, fptag, retaddr); - cpu_stw_data_ra(env, ptr + 6, env->fpip, retaddr); - cpu_stw_data_ra(env, ptr + 8, env->fpcs, retaddr); - cpu_stw_data_ra(env, ptr + 10, env->fpdp, retaddr); - cpu_stw_data_ra(env, ptr + 12, env->fpds, retaddr); + access_stw(ac, ptr, env->fpuc); + access_stw(ac, ptr + 2, fpus); + access_stw(ac, ptr + 4, fptag); + access_stw(ac, ptr + 6, env->fpip); + access_stw(ac, ptr + 8, env->fpcs); + access_stw(ac, ptr + 10, env->fpdp); + access_stw(ac, ptr + 12, env->fpds); } } =20 void helper_fstenv(CPUX86State *env, target_ulong ptr, int data32) { - do_fstenv(env, ptr, data32, GETPC()); + X86Access ac; + + access_prepare(&ac, env, ptr, 14 << data32, MMU_DATA_STORE, GETPC()); + do_fstenv(&ac, ptr, data32); } =20 static void cpu_set_fpus(CPUX86State *env, uint16_t fpus) @@ -2471,12 +2474,12 @@ static void do_fsave(CPUX86State *env, target_ulong= ptr, int data32, { X86Access ac; floatx80 tmp; - int i; + int i, envsize =3D 14 << data32; =20 - do_fstenv(env, ptr, data32, retaddr); + access_prepare(&ac, env, ptr, envsize + 80, MMU_DATA_STORE, retaddr); =20 - ptr +=3D (target_ulong)14 << data32; - access_prepare(&ac, env, ptr, 80, MMU_DATA_STORE, retaddr); + do_fstenv(&ac, ptr, data32); + ptr +=3D envsize; =20 for (i =3D 0; i < 8; i++) { tmp =3D ST(i); --=20 2.34.1