Revision 664e0f19 target-i386/helper2.c

b/target-i386/helper2.c
158 158
    for(i = 0;i < 8; i++)
159 159
        env->fptags[i] = 1;
160 160
    env->fpuc = 0x37f;
161

  
162
    env->mxcsr = 0x1f80;
161 163
}
162 164

  
163 165
void cpu_x86_close(CPUX86State *env)
......
376 378
    }
377 379
    if (flags & X86_DUMP_FPU) {
378 380
        cpu_fprintf(f, "ST0=%f ST1=%f ST2=%f ST3=%f\n", 
379
                (double)env->fpregs[0], 
380
                (double)env->fpregs[1], 
381
                (double)env->fpregs[2], 
382
                (double)env->fpregs[3]);
381
                (double)env->fpregs[0].d, 
382
                (double)env->fpregs[1].d, 
383
                (double)env->fpregs[2].d, 
384
                (double)env->fpregs[3].d);
383 385
        cpu_fprintf(f, "ST4=%f ST5=%f ST6=%f ST7=%f\n", 
384
                (double)env->fpregs[4], 
385
                (double)env->fpregs[5], 
386
                (double)env->fpregs[7], 
387
                (double)env->fpregs[8]);
386
                (double)env->fpregs[4].d, 
387
                (double)env->fpregs[5].d, 
388
                (double)env->fpregs[7].d, 
389
                (double)env->fpregs[8].d);
388 390
    }
389 391
}
390 392

  
......
471 473
        (env->cr[4] & (CR4_PGE_MASK | CR4_PAE_MASK | CR4_PSE_MASK))) {
472 474
        tlb_flush(env, 1);
473 475
    }
476
    /* SSE handling */
477
    if (!(env->cpuid_features & CPUID_SSE))
478
        new_cr4 &= ~CR4_OSFXSR_MASK;
479
    if (new_cr4 & CR4_OSFXSR_MASK)
480
        env->hflags |= HF_OSFXSR_MASK;
481
    else
482
        env->hflags &= ~HF_OSFXSR_MASK;
483

  
474 484
    env->cr[4] = new_cr4;
475 485
}
476 486

  
......
800 810
    fp->fptag = fptag;
801 811
    j = env->fpstt;
802 812
    for(i = 0;i < 8; i++) {
803
        memcpy(&fp->fpregs1[i * 10], &env->fpregs[j], 10);
813
        memcpy(&fp->fpregs1[i * 10], &env->fpregs[j].d, 10);
804 814
        j = (j + 1) & 7;
805 815
    }
806 816
    asm volatile ("frstor %0" : "=m" (*fp));
......
824 834
    }
825 835
    j = env->fpstt;
826 836
    for(i = 0;i < 8; i++) {
827
        memcpy(&env->fpregs[j], &fp->fpregs1[i * 10], 10);
837
        memcpy(&env->fpregs[j].d, &fp->fpregs1[i * 10], 10);
828 838
        j = (j + 1) & 7;
829 839
    }
830 840
    /* we must restore the default rounding state */

Also available in: Unified diff