[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 38/39] target/i386: introduce cpu_set_fpus
From: |
Paolo Bonzini |
Subject: |
[PULL 38/39] target/i386: introduce cpu_set_fpus |
Date: |
Thu, 24 Oct 2019 16:03:54 +0200 |
In the next patch, this will provide a hook to detect clearing of
FSW.ES.
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/fpu_helper.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c
index 4db0059..6825024 100644
--- a/target/i386/fpu_helper.c
+++ b/target/i386/fpu_helper.c
@@ -1053,6 +1053,12 @@ void helper_fstenv(CPUX86State *env, target_ulong ptr,
int data32)
do_fstenv(env, ptr, data32, GETPC());
}
+static void cpu_set_fpus(CPUX86State *env, uint16_t fpus)
+{
+ env->fpstt = (fpus >> 11) & 7;
+ env->fpus = fpus & ~0x3800;
+}
+
static void do_fldenv(CPUX86State *env, target_ulong ptr, int data32,
uintptr_t retaddr)
{
@@ -1067,8 +1073,7 @@ static void do_fldenv(CPUX86State *env, target_ulong ptr,
int data32,
fpus = cpu_lduw_data_ra(env, ptr + 2, retaddr);
fptag = cpu_lduw_data_ra(env, ptr + 4, retaddr);
}
- env->fpstt = (fpus >> 11) & 7;
- env->fpus = fpus & ~0x3800;
+ cpu_set_fpus(env, fpus);
for (i = 0; i < 8; i++) {
env->fptags[i] = ((fptag & 3) == 3);
fptag >>= 2;
@@ -1316,8 +1321,7 @@ static void do_xrstor_fpu(CPUX86State *env, target_ulong
ptr, uintptr_t ra)
fpus = cpu_lduw_data_ra(env, ptr + XO(legacy.fsw), ra);
fptag = cpu_lduw_data_ra(env, ptr + XO(legacy.ftw), ra);
cpu_set_fpuc(env, fpuc);
- env->fpstt = (fpus >> 11) & 7;
- env->fpus = fpus & ~0x3800;
+ cpu_set_fpus(env, fpus);
fptag ^= 0xff;
for (i = 0; i < 8; i++) {
env->fptags[i] = ((fptag >> i) & 1);
--
1.8.3.1
- [PULL 32/39] mc146818rtc: Move RTC_ISA_IRQ definition, (continued)
- [PULL 32/39] mc146818rtc: Move RTC_ISA_IRQ definition, Paolo Bonzini, 2019/10/24
- [PULL 25/39] x86/cpu: Add support for UMONITOR/UMWAIT/TPAUSE, Paolo Bonzini, 2019/10/24
- [PULL 29/39] hw/i386/pc: Extract pc_i8259_create(), Paolo Bonzini, 2019/10/24
- [PULL 33/39] mc146818rtc: Include mc146818rtc_regs.h directly in mc146818rtc.c, Paolo Bonzini, 2019/10/24
- [PULL 13/39] hw/i386/pc: move shared x86 functions to x86.c and export them, Paolo Bonzini, 2019/10/24
- [PULL 27/39] hw/i386/pc: Extract pc_gsi_create(), Paolo Bonzini, 2019/10/24
- [PULL 31/39] mc146818rtc: move structure to header file, Paolo Bonzini, 2019/10/24
- [PULL 35/39] audio: fix missing break, Paolo Bonzini, 2019/10/24
- [PULL 38/39] target/i386: introduce cpu_set_fpus,
Paolo Bonzini <=
- [PULL 37/39] target/i386: move FERR handling to target/i386, Paolo Bonzini, 2019/10/24
- [PULL 34/39] mc146818rtc: always register rtc to rtc list, Paolo Bonzini, 2019/10/24
- [PULL 39/39] i386: implement IGNNE, Paolo Bonzini, 2019/10/24
- [PULL 36/39] core: replace getpagesize() with qemu_real_host_page_size, Paolo Bonzini, 2019/10/24
- Re: [PULL 00/39] Misc (mostly x86) patches for 2019-10-24, no-reply, 2019/10/25
- Re: [PULL 00/39] Misc (mostly x86) patches for 2019-10-24, Peter Maydell, 2019/10/25