Commit 8636b5d873d6fa5696385da80ddd5f03e1a5de4c
1 parent
664e0f19
compilation fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1206 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
24 additions
and
18 deletions
vl.c
@@ -2113,20 +2113,22 @@ void cpu_save(QEMUFile *f, void *opaque) | @@ -2113,20 +2113,22 @@ void cpu_save(QEMUFile *f, void *opaque) | ||
2113 | qemu_put_be16s(f, &fpregs_format); | 2113 | qemu_put_be16s(f, &fpregs_format); |
2114 | 2114 | ||
2115 | for(i = 0; i < 8; i++) { | 2115 | for(i = 0; i < 8; i++) { |
2116 | - uint64_t mant; | ||
2117 | - uint16_t exp; | ||
2118 | #ifdef USE_X86LDOUBLE | 2116 | #ifdef USE_X86LDOUBLE |
2119 | - /* we save the real CPU data (in case of MMX usage only 'mant' | ||
2120 | - contains the MMX register */ | ||
2121 | - cpu_get_fp80(&mant, &exp, env->fpregs[i].d); | ||
2122 | - qemu_put_be64(f, mant); | ||
2123 | - qemu_put_be16(f, exp); | 2117 | + { |
2118 | + uint64_t mant; | ||
2119 | + uint16_t exp; | ||
2120 | + /* we save the real CPU data (in case of MMX usage only 'mant' | ||
2121 | + contains the MMX register */ | ||
2122 | + cpu_get_fp80(&mant, &exp, env->fpregs[i].d); | ||
2123 | + qemu_put_be64(f, mant); | ||
2124 | + qemu_put_be16(f, exp); | ||
2125 | + } | ||
2124 | #else | 2126 | #else |
2125 | /* if we use doubles for float emulation, we save the doubles to | 2127 | /* if we use doubles for float emulation, we save the doubles to |
2126 | avoid losing information in case of MMX usage. It can give | 2128 | avoid losing information in case of MMX usage. It can give |
2127 | problems if the image is restored on a CPU where long | 2129 | problems if the image is restored on a CPU where long |
2128 | doubles are used instead. */ | 2130 | doubles are used instead. */ |
2129 | - qemu_put_be64(f, env->fpregs[i].xmm.MMX_Q(0)); | 2131 | + qemu_put_be64(f, env->fpregs[i].mmx.MMX_Q(0)); |
2130 | #endif | 2132 | #endif |
2131 | } | 2133 | } |
2132 | 2134 | ||
@@ -2169,6 +2171,7 @@ void cpu_save(QEMUFile *f, void *opaque) | @@ -2169,6 +2171,7 @@ void cpu_save(QEMUFile *f, void *opaque) | ||
2169 | #endif | 2171 | #endif |
2170 | } | 2172 | } |
2171 | 2173 | ||
2174 | +#ifdef USE_X86LDOUBLE | ||
2172 | /* XXX: add that in a FPU generic layer */ | 2175 | /* XXX: add that in a FPU generic layer */ |
2173 | union x86_longdouble { | 2176 | union x86_longdouble { |
2174 | uint64_t mant; | 2177 | uint64_t mant; |
@@ -2190,6 +2193,7 @@ static void fp64_to_fp80(union x86_longdouble *p, uint64_t temp) | @@ -2190,6 +2193,7 @@ static void fp64_to_fp80(union x86_longdouble *p, uint64_t temp) | ||
2190 | e |= SIGND1(temp) >> 16; | 2193 | e |= SIGND1(temp) >> 16; |
2191 | p->exp = e; | 2194 | p->exp = e; |
2192 | } | 2195 | } |
2196 | +#endif | ||
2193 | 2197 | ||
2194 | int cpu_load(QEMUFile *f, void *opaque, int version_id) | 2198 | int cpu_load(QEMUFile *f, void *opaque, int version_id) |
2195 | { | 2199 | { |
@@ -2218,7 +2222,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) | @@ -2218,7 +2222,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) | ||
2218 | for(i = 0; i < 8; i++) { | 2222 | for(i = 0; i < 8; i++) { |
2219 | uint64_t mant; | 2223 | uint64_t mant; |
2220 | uint16_t exp; | 2224 | uint16_t exp; |
2221 | - union x86_longdouble *p; | ||
2222 | 2225 | ||
2223 | switch(fpregs_format) { | 2226 | switch(fpregs_format) { |
2224 | case 0: | 2227 | case 0: |
@@ -2229,7 +2232,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) | @@ -2229,7 +2232,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) | ||
2229 | #else | 2232 | #else |
2230 | /* difficult case */ | 2233 | /* difficult case */ |
2231 | if (guess_mmx) | 2234 | if (guess_mmx) |
2232 | - env->fpregs[i].xmm.MMX_Q(0) = mant; | 2235 | + env->fpregs[i].mmx.MMX_Q(0) = mant; |
2233 | else | 2236 | else |
2234 | env->fpregs[i].d = cpu_set_fp80(mant, exp); | 2237 | env->fpregs[i].d = cpu_set_fp80(mant, exp); |
2235 | #endif | 2238 | #endif |
@@ -2237,16 +2240,19 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) | @@ -2237,16 +2240,19 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) | ||
2237 | case 1: | 2240 | case 1: |
2238 | mant = qemu_get_be64(f); | 2241 | mant = qemu_get_be64(f); |
2239 | #ifdef USE_X86LDOUBLE | 2242 | #ifdef USE_X86LDOUBLE |
2240 | - /* difficult case */ | ||
2241 | - p = (void *)&env->fpregs[i]; | ||
2242 | - if (guess_mmx) { | ||
2243 | - p->mant = mant; | ||
2244 | - p->exp = 0xffff; | ||
2245 | - } else { | ||
2246 | - fp64_to_fp80(p, mant); | 2243 | + { |
2244 | + union x86_longdouble *p; | ||
2245 | + /* difficult case */ | ||
2246 | + p = (void *)&env->fpregs[i]; | ||
2247 | + if (guess_mmx) { | ||
2248 | + p->mant = mant; | ||
2249 | + p->exp = 0xffff; | ||
2250 | + } else { | ||
2251 | + fp64_to_fp80(p, mant); | ||
2252 | + } | ||
2247 | } | 2253 | } |
2248 | #else | 2254 | #else |
2249 | - env->fpregs[i].xmm.MMX_Q(0) = mant; | 2255 | + env->fpregs[i].mmx.MMX_Q(0) = mant; |
2250 | #endif | 2256 | #endif |
2251 | break; | 2257 | break; |
2252 | default: | 2258 | default: |