mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-18 23:52:14 -06:00
target/i386: introduce cpu_set_fpus
In the next patch, this will provide a hook to detect clearing of FSW.ES. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6f529b7534
commit
5caa1833d2
1 changed files with 8 additions and 4 deletions
|
@ -1053,6 +1053,12 @@ void helper_fstenv(CPUX86State *env, target_ulong ptr, int data32)
|
||||||
do_fstenv(env, ptr, data32, GETPC());
|
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,
|
static void do_fldenv(CPUX86State *env, target_ulong ptr, int data32,
|
||||||
uintptr_t retaddr)
|
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);
|
fpus = cpu_lduw_data_ra(env, ptr + 2, retaddr);
|
||||||
fptag = cpu_lduw_data_ra(env, ptr + 4, retaddr);
|
fptag = cpu_lduw_data_ra(env, ptr + 4, retaddr);
|
||||||
}
|
}
|
||||||
env->fpstt = (fpus >> 11) & 7;
|
cpu_set_fpus(env, fpus);
|
||||||
env->fpus = fpus & ~0x3800;
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
env->fptags[i] = ((fptag & 3) == 3);
|
env->fptags[i] = ((fptag & 3) == 3);
|
||||||
fptag >>= 2;
|
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);
|
fpus = cpu_lduw_data_ra(env, ptr + XO(legacy.fsw), ra);
|
||||||
fptag = cpu_lduw_data_ra(env, ptr + XO(legacy.ftw), ra);
|
fptag = cpu_lduw_data_ra(env, ptr + XO(legacy.ftw), ra);
|
||||||
cpu_set_fpuc(env, fpuc);
|
cpu_set_fpuc(env, fpuc);
|
||||||
env->fpstt = (fpus >> 11) & 7;
|
cpu_set_fpus(env, fpus);
|
||||||
env->fpus = fpus & ~0x3800;
|
|
||||||
fptag ^= 0xff;
|
fptag ^= 0xff;
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
env->fptags[i] = ((fptag >> i) & 1);
|
env->fptags[i] = ((fptag >> i) & 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue