From: Richard Henderson <richard.henderson@linaro.org>
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 [thread overview]
Message-ID: <20240515150837.259747-4-richard.henderson@linaro.org> (raw)
In-Reply-To: <20240515150837.259747-1-richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
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);
}
--
2.34.1
next prev parent reply other threads:[~2024-05-15 15:09 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 15:08 [PATCH v3 00/28] linux-user/i386: Properly align signal frame Richard Henderson
2024-05-15 15:08 ` [PATCH v3 01/28] target/i386: Add tcg/access.[ch] Richard Henderson
2024-05-15 15:08 ` [PATCH v3 02/28] target/i386: Convert do_fldt, do_fstt to X86Access Richard Henderson
2024-05-15 15:08 ` Richard Henderson [this message]
2024-05-15 15:08 ` [PATCH v3 04/28] target/i386: Convert do_fldenv " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 05/28] target/i386: Convert do_fstenv " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 06/28] target/i386: Convert do_fsave, do_frstor " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 07/28] target/i386: Convert do_xsave_{fpu, mxcr, sse} " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 08/28] target/i386: Convert do_xrstor_{fpu, " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 09/28] tagret/i386: Convert do_fxsave, do_fxrstor " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 10/28] target/i386: Convert do_xsave_* " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 11/28] target/i386: Convert do_xrstor_* " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 12/28] target/i386: Split out do_xsave_chk Richard Henderson
2024-05-15 15:08 ` [PATCH v3 13/28] target/i386: Add rbfm argument to cpu_x86_{xsave, xrstor} Richard Henderson
2024-05-15 15:08 ` [PATCH v3 14/28] target/i386: Add {hw, sw}_reserved to X86LegacyXSaveArea Richard Henderson
2024-05-15 15:08 ` [PATCH v3 15/28] linux-user/i386: Drop xfeatures_size from sigcontext arithmetic Richard Henderson
2024-05-15 15:08 ` [PATCH v3 16/28] linux-user/i386: Remove xfeatures from target_fpstate_fxsave Richard Henderson
2024-05-15 15:08 ` [PATCH v3 17/28] linux-user/i386: Replace target_fpstate_fxsave with X86LegacyXSaveArea Richard Henderson
2024-05-15 15:08 ` [PATCH v3 18/28] linux-user/i386: Split out struct target_fregs_state Richard Henderson
2024-05-15 15:08 ` [PATCH v3 19/28] linux-user/i386: Fix -mregparm=3 for signal delivery Richard Henderson
2024-05-15 15:08 ` [PATCH v3 20/28] linux-user/i386: Return boolean success from restore_sigcontext Richard Henderson
2024-05-15 15:08 ` [PATCH v3 21/28] linux-user/i386: Return boolean success from xrstor_sigcontext Richard Henderson
2024-05-15 15:08 ` [PATCH v3 22/28] linux-user/i386: Fix allocation and alignment of fp state Richard Henderson
2024-05-15 15:08 ` [PATCH v3 23/28] target/i386: Honor xfeatures in xrstor_sigcontext Richard Henderson
2024-05-15 15:08 ` [PATCH v3 24/28] target/i386: Convert do_xsave to X86Access Richard Henderson
2024-05-15 15:08 ` [PATCH v3 25/28] target/i386: Convert do_xrstor " Richard Henderson
2024-05-15 15:08 ` [PATCH v3 26/28] target/i386: Pass host pointer and size to cpu_x86_{fsave, frstor} Richard Henderson
2024-05-15 15:08 ` [PATCH v3 27/28] target/i386: Pass host pointer and size to cpu_x86_{fxsave, fxrstor} Richard Henderson
2024-05-15 15:08 ` [PATCH v3 28/28] target/i386: Pass host pointer and size to cpu_x86_{xsave, xrstor} Richard Henderson
2024-06-05 19:06 ` [PATCH v3 00/28] linux-user/i386: Properly align signal frame Philippe Mathieu-Daudé
2024-06-05 19:16 ` Pierrick Bouvier
2024-06-05 19:38 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240515150837.259747-4-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).