mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 03:59:52 +00:00
compilation fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1206 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
664e0f195a
commit
8636b5d873
42
vl.c
42
vl.c
@ -2113,20 +2113,22 @@ void cpu_save(QEMUFile *f, void *opaque)
|
|||||||
qemu_put_be16s(f, &fpregs_format);
|
qemu_put_be16s(f, &fpregs_format);
|
||||||
|
|
||||||
for(i = 0; i < 8; i++) {
|
for(i = 0; i < 8; i++) {
|
||||||
uint64_t mant;
|
|
||||||
uint16_t exp;
|
|
||||||
#ifdef USE_X86LDOUBLE
|
#ifdef USE_X86LDOUBLE
|
||||||
/* we save the real CPU data (in case of MMX usage only 'mant'
|
{
|
||||||
contains the MMX register */
|
uint64_t mant;
|
||||||
cpu_get_fp80(&mant, &exp, env->fpregs[i].d);
|
uint16_t exp;
|
||||||
qemu_put_be64(f, mant);
|
/* we save the real CPU data (in case of MMX usage only 'mant'
|
||||||
qemu_put_be16(f, exp);
|
contains the MMX register */
|
||||||
|
cpu_get_fp80(&mant, &exp, env->fpregs[i].d);
|
||||||
|
qemu_put_be64(f, mant);
|
||||||
|
qemu_put_be16(f, exp);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/* if we use doubles for float emulation, we save the doubles to
|
/* if we use doubles for float emulation, we save the doubles to
|
||||||
avoid losing information in case of MMX usage. It can give
|
avoid losing information in case of MMX usage. It can give
|
||||||
problems if the image is restored on a CPU where long
|
problems if the image is restored on a CPU where long
|
||||||
doubles are used instead. */
|
doubles are used instead. */
|
||||||
qemu_put_be64(f, env->fpregs[i].xmm.MMX_Q(0));
|
qemu_put_be64(f, env->fpregs[i].mmx.MMX_Q(0));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2169,6 +2171,7 @@ void cpu_save(QEMUFile *f, void *opaque)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_X86LDOUBLE
|
||||||
/* XXX: add that in a FPU generic layer */
|
/* XXX: add that in a FPU generic layer */
|
||||||
union x86_longdouble {
|
union x86_longdouble {
|
||||||
uint64_t mant;
|
uint64_t mant;
|
||||||
@ -2190,6 +2193,7 @@ static void fp64_to_fp80(union x86_longdouble *p, uint64_t temp)
|
|||||||
e |= SIGND1(temp) >> 16;
|
e |= SIGND1(temp) >> 16;
|
||||||
p->exp = e;
|
p->exp = e;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int cpu_load(QEMUFile *f, void *opaque, int version_id)
|
int cpu_load(QEMUFile *f, void *opaque, int version_id)
|
||||||
{
|
{
|
||||||
@ -2218,7 +2222,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
|
|||||||
for(i = 0; i < 8; i++) {
|
for(i = 0; i < 8; i++) {
|
||||||
uint64_t mant;
|
uint64_t mant;
|
||||||
uint16_t exp;
|
uint16_t exp;
|
||||||
union x86_longdouble *p;
|
|
||||||
|
|
||||||
switch(fpregs_format) {
|
switch(fpregs_format) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -2229,7 +2232,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
|
|||||||
#else
|
#else
|
||||||
/* difficult case */
|
/* difficult case */
|
||||||
if (guess_mmx)
|
if (guess_mmx)
|
||||||
env->fpregs[i].xmm.MMX_Q(0) = mant;
|
env->fpregs[i].mmx.MMX_Q(0) = mant;
|
||||||
else
|
else
|
||||||
env->fpregs[i].d = cpu_set_fp80(mant, exp);
|
env->fpregs[i].d = cpu_set_fp80(mant, exp);
|
||||||
#endif
|
#endif
|
||||||
@ -2237,16 +2240,19 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
|
|||||||
case 1:
|
case 1:
|
||||||
mant = qemu_get_be64(f);
|
mant = qemu_get_be64(f);
|
||||||
#ifdef USE_X86LDOUBLE
|
#ifdef USE_X86LDOUBLE
|
||||||
/* difficult case */
|
{
|
||||||
p = (void *)&env->fpregs[i];
|
union x86_longdouble *p;
|
||||||
if (guess_mmx) {
|
/* difficult case */
|
||||||
p->mant = mant;
|
p = (void *)&env->fpregs[i];
|
||||||
p->exp = 0xffff;
|
if (guess_mmx) {
|
||||||
} else {
|
p->mant = mant;
|
||||||
fp64_to_fp80(p, mant);
|
p->exp = 0xffff;
|
||||||
|
} else {
|
||||||
|
fp64_to_fp80(p, mant);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
env->fpregs[i].xmm.MMX_Q(0) = mant;
|
env->fpregs[i].mmx.MMX_Q(0) = mant;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user