MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / fpu_reset

Function fpu_reset

src/fpp.cpp:3676–3734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3674#endif
3675
3676void fpu_reset (void)
3677{
3678#ifndef CPU_TESTER
3679 currprefs.fpu_mode = changed_prefs.fpu_mode;
3680 if (currprefs.fpu_mode > 0) {
3681#ifdef WITH_SOFTFLOAT
3682 fp_init_softfloat(currprefs.fpu_model);
3683#endif
3684#ifdef MSVC_LONG_DOUBLE
3685 use_long_double = false;
3686 } else if (currprefs.fpu_mode < 0) {
3687 use_long_double = true;
3688 if (!fp_init_native_80()) {
3689 use_long_double = false;
3690 fp_init_softfloat(currprefs.fpu_model);
3691 }
3692#endif
3693 } else {
3694#ifdef MSVC_LONG_DOUBLE
3695 use_long_double = false;
3696#endif
3697 fp_init_native();
3698 }
3699
3700#if defined(CPU_i386) || defined(CPU_x86_64)
3701#ifndef __MACH__
3702#ifndef __ANDROID__
3703 init_fpucw_x87();
3704#endif
3705#endif
3706
3707#ifdef MSVC_LONG_DOUBLE
3708 init_fpucw_x87_80();
3709#endif
3710#endif
3711#else
3712 fp_init_softfloat(currprefs.fpu_model);
3713 use_long_double = false;
3714#endif
3715
3716 regs.fpu_exp_state = 0;
3717 regs.fp_unimp_pend = 0;
3718 regs.fp_ea_set = false;
3719 get_features();
3720 fpp_set_fpcr (0);
3721 fpp_set_fpsr (0);
3722 fpp_set_fpiar (0);
3723#ifndef AMIBERRY
3724 fpux_restore (NULL);
3725#endif
3726 // reset precision
3727 fpp_set_mode(0x00000080 | 0x00000010);
3728 fpp_set_mode(0x00000000);
3729
3730#if FPU_TEST
3731 fpu_test();
3732#endif
3733

Callers 4

restore_fpuFunction · 0.85
testFunction · 0.85
m68k_reset2Function · 0.85
restore_cpu_finishFunction · 0.85

Calls 11

fp_init_softfloatFunction · 0.85
fp_init_native_80Function · 0.85
init_fpucw_x87_80Function · 0.85
get_featuresFunction · 0.85
fpp_set_fpcrFunction · 0.85
fpp_set_fpsrFunction · 0.85
fpp_set_fpiarFunction · 0.85
fpux_restoreFunction · 0.85
fpu_testFunction · 0.85
fp_init_nativeFunction · 0.70
init_fpucw_x87Function · 0.70

Tested by 1

testFunction · 0.68