From patchwork Wed May 15 15:08:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 796958 Delivered-To: patch@linaro.org Received: by 2002:a5d:452e:0:b0:34e:ceec:bfcd with SMTP id j14csp3032340wra; Wed, 15 May 2024 08:09:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBcOxYCnPYczZDc49rduZNR0cAD/f4XLIyhvFZXCKr7sh+t46kcnf6ENU0HmlyDJIjzuFFQfU+JLFGQlKzTpKJ X-Google-Smtp-Source: AGHT+IEpd53OGnBSs/I/JOo/fVwfhhutDeAo2eKfstx8pnmDxmrLHnU4rRlSP3TMaVmxO+QUIaJp X-Received: by 2002:a05:6102:3a14:b0:47f:1fbf:f4d with SMTP id ada2fe7eead31-48077e7b72cmr13450215137.23.1715785789140; Wed, 15 May 2024 08:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715785789; cv=none; d=google.com; s=arc-20160816; b=ZHUOpHQlmhJ+bKzHETlcbnK5HqHy5IxPas88MxRuC0LQzRrlVaoPGonw3CN5wIUWCj BFr4GGX5RtN9WpxSl+VFsQd0IeaCx8P8V+ElEvHTFdM9cPDP8scO3moRKnPmrmPyawt6 zH6BzonpFdyypapbtdzlmy2sjAo8tYqHf0gYdBJ5HY6K+bKEp/gTf25jVZRn8o3CNHBm MR4LGo3fIKtZASfLamPj891KlCvV6FV3ncb6Ycgel30ykN/RCT7OEKQlNI0VbMwhvuqC O+XrkKrFgm7/c9leYbcwdHOrOMV0m2DVRvn9ol46LoJl3Hd1XfGSRVcLqj08Sej0JLTw OJbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=65Gkdr7ftr6lyKPmfr51rDrQ5Maa9PeaHdOx7rkPnQ4=; fh=X011yTyqhApvEaDulZV+xVgKKBTjUS9dtQWFbmf3LLM=; b=FL6XvG8XfE48UwR8QAGC8auVTh04TG8xUFK2T6ua8Dgewk79QAy/lGF/N9UXKRpOTW qWWkvaShgq2suVAVBHGv3XUBd2PZBr9p6s0Qp/mXpQ2AEN55q/jb3WsyFQngkBiEVGsl cohNPoysSwH3ku5nCXYIfZxAhk5337ABCh1uhaG06BIMsBhy9SqoR8dgfacogdX7u67W SV9O17llOyQ/hktW5av9uyLeN5BwYIVqbvekvMhq0uFdzu285aqRdYbEUF8fRweZPiNI iYqrlGK8MSfbX2hiEQ3gnzwYwUTcOpkr78+/b8OVks0Unc3sWCQTRibaoDa74XJ5+cgr ThSA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CC+G5yAZ; 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=fail (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 ada2fe7eead31-4807384b6dcsi2426280137.742.2024.05.15.08.09.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2024 08:09:49 -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=fail header.i=@linaro.org header.s=google header.b=CC+G5yAZ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7GFN-0003qY-6w; Wed, 15 May 2024 11:08:49 -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 1s7GFI-0003pT-Dl for qemu-devel@nongnu.org; Wed, 15 May 2024 11:08:45 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7GFG-0002ng-L4 for qemu-devel@nongnu.org; Wed, 15 May 2024 11:08:44 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2e0933d3b5fso103891461fa.2 for ; Wed, 15 May 2024 08:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715785721; x=1716390521; 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=65Gkdr7ftr6lyKPmfr51rDrQ5Maa9PeaHdOx7rkPnQ4=; b=CC+G5yAZSQuIyP5KOiDdRhafBLp4dEwJ1yDQpr9C240Yw1Hj8DPqvD3s/CN5KLqZGA 9bIM0NHR2SvdJ2VEOK9zlad55lZsu3jITlVXZxrKgU2JOLjKK68zzRyuJYPk8yARt1zI r4DKGPNHvj61oUvfWr+D4HTV4DV2oaDJzBMhBbfjEJ9cvzAX3xKMpsR9C/BrVTAZipRc Yw6AssB3Bws3Cv/wckK+YWryjX8BwNfyH3Y+S0EQflXP96bStl3PkQRbBe4ZBalebNM/ stYL4bDZExuHuxOqqXzmQECRdyCiyhOUiQF+NLra+uzGm+S7jyhgqHy/XuPIcuk2ec7L sA9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715785721; x=1716390521; 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=65Gkdr7ftr6lyKPmfr51rDrQ5Maa9PeaHdOx7rkPnQ4=; b=dTNLqwXRtxOrtsiHlprqENQrFihEMtkJC8m+jZud/XXQLbdTIOL4hEFxejvta8Ft/I 5HOZ5PN8lNJyNNwi79WvRV64SWtxwBWUmwmxb3gAjR5ix7sl84H7A4yqRQC8/8cmflZn +wj1+vpE+HbgHQ7nG+h4hSQf3kF3AyTiIe17PNbMhjGT8qZ4S2JqrREhISZRdAwKgHo1 /EF07KcS5lnVfkxvN+mnHAHg7TW6InEfgTLuuTYG7uNrM1i9K+cf0QB4P5WVoFe1I5UC sGJPCnv0f/wppYJ5as5HT5+8/vaPS70LEX97iyPdBMlsshUL01Fr/KLnUJv3HiQAA0ym t3TQ== X-Gm-Message-State: AOJu0YwGb33JFWCvHrezK/NKYTLffPOrj/4c3TzY516r+vq9ourJDNTj EOI6nCiWSLuoTFLLDNW0WFdfw4HZ/RroKj6ANfekw3V30ciEv+3vUay4oDRivENiGMaC7V6b6T5 caLc= X-Received: by 2002:a2e:2a83:0:b0:2e2:2791:9842 with SMTP id 38308e7fff4ca-2e5204ac519mr97256021fa.44.1715785720940; Wed, 15 May 2024 08:08:40 -0700 (PDT) Received: from stoup.. ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42013c5fa61sm132080825e9.40.2024.05.15.08.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 08:08:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, laurent@vivier.eu Subject: [PATCH v3 03/28] target/i386: Convert helper_{fbld, fbst}_ST0 to X86Access Date: Wed, 15 May 2024 17:08:12 +0200 Message-Id: <20240515150837.259747-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240515150837.259747-1-richard.henderson@linaro.org> References: <20240515150837.259747-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=richard.henderson@linaro.org; helo=mail-lj1-x232.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 1662643a8f..6237cd8383 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -773,18 +773,21 @@ void helper_fninit(CPUX86State *env) void helper_fbld_ST0(CPUX86State *env, target_ulong ptr) { + X86Access ac; floatx80 tmp; uint64_t val; unsigned int v; int i; + access_prepare(&ac, env, ptr, 10, MMU_DATA_LOAD, GETPC()); + val = 0; for (i = 8; i >= 0; i--) { - v = cpu_ldub_data_ra(env, ptr + i, GETPC()); + v = access_ldb(&ac, ptr + i); val = (val * 100) + ((v >> 4) * 10) + (v & 0xf); } tmp = int64_to_floatx80(val, &env->fp_status); - if (cpu_ldub_data_ra(env, ptr + 9, GETPC()) & 0x80) { + if (access_ldb(&ac, ptr + 9) & 0x80) { tmp = floatx80_chs(tmp); } fpush(env); @@ -798,7 +801,9 @@ void helper_fbst_ST0(CPUX86State *env, target_ulong ptr) target_ulong mem_ref, mem_end; int64_t val; CPU_LDoubleU temp; + X86Access ac; + access_prepare(&ac, env, ptr, 10, MMU_DATA_STORE, GETPC()); temp.d = ST0; val = floatx80_to_int64(ST0, &env->fp_status); @@ -806,20 +811,20 @@ void helper_fbst_ST0(CPUX86State *env, target_ulong ptr) if (val >= 1000000000000000000LL || val <= -1000000000000000000LL) { set_float_exception_flags(float_flag_invalid, &env->fp_status); while (mem_ref < ptr + 7) { - cpu_stb_data_ra(env, mem_ref++, 0, GETPC()); + access_stb(&ac, mem_ref++, 0); } - cpu_stb_data_ra(env, mem_ref++, 0xc0, GETPC()); - cpu_stb_data_ra(env, mem_ref++, 0xff, GETPC()); - cpu_stb_data_ra(env, mem_ref++, 0xff, GETPC()); + access_stb(&ac, mem_ref++, 0xc0); + access_stb(&ac, mem_ref++, 0xff); + access_stb(&ac, mem_ref++, 0xff); merge_exception_flags(env, old_flags); return; } mem_end = mem_ref + 9; if (SIGND(temp)) { - cpu_stb_data_ra(env, mem_end, 0x80, GETPC()); + access_stb(&ac, mem_end, 0x80); val = -val; } else { - cpu_stb_data_ra(env, mem_end, 0x00, GETPC()); + access_stb(&ac, mem_end, 0x00); } while (mem_ref < mem_end) { if (val == 0) { @@ -828,10 +833,10 @@ void helper_fbst_ST0(CPUX86State *env, target_ulong ptr) v = val % 100; val = val / 100; v = ((v / 10) << 4) | (v % 10); - cpu_stb_data_ra(env, mem_ref++, v, GETPC()); + access_stb(&ac, mem_ref++, v); } while (mem_ref < mem_end) { - cpu_stb_data_ra(env, mem_ref++, 0, GETPC()); + access_stb(&ac, mem_ref++, 0); } merge_exception_flags(env, old_flags); }