From nobody Mon Nov 25 09:28:31 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=1716771135; cv=none; d=zohomail.com; s=zohoarc; b=EQKQpCrqVu3yApomRjLi/ogK+70+mJB9iUPQxJxeyp+28EJhCnaq63/tMJj7os/lBpdXwmLWeF2kdr4kz1wr+Od8Ss3nG/epH3olnIJdFQXzK8znc3mPFJeYqB1rKP+aGENTABg1mnN+oHAh4cKpAn9UEpoy54z+w7EQtYcGRI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716771135; 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=FRv9/cJI78XP3U2PIccw7jXbddClyYk+zoUNxwDaOdI=; b=FArCoZTc56v1FSTNlgCYKmmw9Rg8RbcZ/tg9JWf7noiigo3GKwRTrJpL1I6VItxSbuz4a6/r7f2qc74rIPsYpjj+7x/gcaEipwI+7O9DHi3tVJDNP+4X2oO+lceBr2Bni9etmskWr+4xBr4aCWWRe1mYpyXx+3I3mx3AeJMXMwM= 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 171677113510219.786899547837606; Sun, 26 May 2024 17:52:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBOZL-0007FE-0u; 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 1sBOZ3-00073c-5q for qemu-devel@nongnu.org; Sun, 26 May 2024 20:50:13 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBOYw-0003Zx-UY for qemu-devel@nongnu.org; Sun, 26 May 2024 20:50:11 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6fbbd937719so1507268b3a.0 for ; Sun, 26 May 2024 17:50:06 -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.04 (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=1716771005; x=1717375805; 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=FRv9/cJI78XP3U2PIccw7jXbddClyYk+zoUNxwDaOdI=; b=I5oMJeDNl4JEUQ3/TjRV5w/WWYnX4SXc6ScOTfK+VrFiMPFmN4YyeovCv/vE5SHjW+ iShB42JA0hcZ98fFV6k1oYwz9GjMmJGCcwKxo3KEIEDzZAJWY8ZwatRe9gMo5R34WZVC AbyLJA+QFvaIkSsPkOtMgV5enXu6OXxpei4prP/aSCwfYfxB4IqMbu1noZiSjqNOfvqW Q9DQbxmNC6cmMN7Nyn4zffcL/gjFurFPg0JLYQWxES6CP8EcmX9FRxIq9HUyi15x0BjC YnBBN7iZtmEVLz8h4Bb8DGkcKwTFu5kGyBPAkDAtHMBpoL71FaTm0uEdxxy99vWbognZ WOYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716771005; x=1717375805; 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=FRv9/cJI78XP3U2PIccw7jXbddClyYk+zoUNxwDaOdI=; b=dV8ULfMlTKn6DdTJzPvZ7k39rPZa9P/3vaYC+VL72WOm7D0lGJ+fUkBEZpYMQbPRVV QBQLqwFSeEmZgrHjrn7Hx1T1wTumHkayrOrrlweM6Kk7wrp9ZfVamEM+G+pD5KUJvR4V ilTHYqg/6+Rya1hexcDLZ1IUfGff5eMRU8RenKEAgBrGlROHo8k6jAkLHOahnqFQUwKi i+b09uayuCV6e1CSj8YIELZOpbwVnXeIPURsHKw1nfYQnihqwXS4lqmsyJXAUt1TaqUZ wCjdaK2KqZk3RiHl897OBQyQ3A+68uoBOU8TvqnepcINYhhUkqKoRyxjbzZmCYPpDb10 6V/A== X-Gm-Message-State: AOJu0YwSlTGx/Sh2T2fCi4l/1hds9SmRMk6PvX8KWgnzzbEktnVoX5Ul Js7Ei5+MtzM92uxos+GRGpxzfsI3l9jLk6C8ma+2IjTTcdunvG7kMhvYxC9wYIdSwvRRfCo/cU+ S X-Google-Smtp-Source: AGHT+IGMHIalIfhp9vTk6XTMMuLyBiEYA5HOnrW43s319awvR25zRNSeEgQ/65TT2zua/wMs1JLOWQ== X-Received: by 2002:a05:6a20:9708:b0:1af:5195:d035 with SMTP id adf61e73a8af0-1b212df055cmr6633750637.45.1716771005608; Sun, 26 May 2024 17:50:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Paolo Bonzini Subject: [PULL 04/28] target/i386: Convert do_fldenv to X86Access Date: Sun, 26 May 2024 17:49:37 -0700 Message-Id: <20240527005001.642825-5-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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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: 1716771135583100001 Content-Type: text/plain; charset="utf-8" Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 6237cd8383..5ad6e04639 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -2442,20 +2442,15 @@ static void cpu_set_fpus(CPUX86State *env, uint16_t= fpus) #endif } =20 -static void do_fldenv(CPUX86State *env, target_ulong ptr, int data32, - uintptr_t retaddr) +static void do_fldenv(X86Access *ac, target_ulong ptr, int data32) { int i, fpus, fptag; + CPUX86State *env =3D ac->env; + + cpu_set_fpuc(env, access_ldw(ac, ptr)); + fpus =3D access_ldw(ac, ptr + (2 << data32)); + fptag =3D access_ldw(ac, ptr + (4 << data32)); =20 - if (data32) { - cpu_set_fpuc(env, cpu_lduw_data_ra(env, ptr, retaddr)); - fpus =3D cpu_lduw_data_ra(env, ptr + 4, retaddr); - fptag =3D cpu_lduw_data_ra(env, ptr + 8, retaddr); - } else { - cpu_set_fpuc(env, cpu_lduw_data_ra(env, ptr, retaddr)); - fpus =3D cpu_lduw_data_ra(env, ptr + 2, retaddr); - fptag =3D cpu_lduw_data_ra(env, ptr + 4, retaddr); - } cpu_set_fpus(env, fpus); for (i =3D 0; i < 8; i++) { env->fptags[i] =3D ((fptag & 3) =3D=3D 3); @@ -2465,7 +2460,10 @@ static void do_fldenv(CPUX86State *env, target_ulong= ptr, int data32, =20 void helper_fldenv(CPUX86State *env, target_ulong ptr, int data32) { - do_fldenv(env, ptr, data32, GETPC()); + X86Access ac; + + access_prepare(&ac, env, ptr, 14 << data32, MMU_DATA_STORE, GETPC()); + do_fldenv(&ac, ptr, data32); } =20 static void do_fsave(CPUX86State *env, target_ulong ptr, int data32, @@ -2499,12 +2497,12 @@ static void do_frstor(CPUX86State *env, target_ulon= g ptr, int data32, { X86Access ac; floatx80 tmp; - int i; + int i, envsize =3D 14 << data32; =20 - do_fldenv(env, ptr, data32, retaddr); - ptr +=3D (target_ulong)14 << data32; + access_prepare(&ac, env, ptr, envsize + 80, MMU_DATA_LOAD, retaddr); =20 - access_prepare(&ac, env, ptr, 80, MMU_DATA_LOAD, retaddr); + do_fldenv(&ac, ptr, data32); + ptr +=3D envsize; =20 for (i =3D 0; i < 8; i++) { tmp =3D do_fldt(&ac, ptr); --=20 2.34.1