Jit: Raise program exception on floating point exceptions

This is done entirely through interpreter fallbacks. It would
probably be possible to implement this using host exception
handlers instead, but I think it would be a lot of complexity
for a rarely used feature, so let's not do it for now.

For performance reasons, there are two settings for this feature:
One setting which does enables just what True Crime: New York City
needs and one setting which enables it all. The latter makes
almost all float instructions fall back to the interpreter.
This commit is contained in:
JosJuice
2021-08-18 12:39:02 +02:00
parent 7f7748e181
commit 9f525d69c8
24 changed files with 216 additions and 88 deletions

View File

@ -213,6 +213,8 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance);
core->Set("SyncGpuMinDistance", iSyncGpuMinDistance);
core->Set("SyncGpuOverclock", fSyncGpuOverclock);
core->Set("FloatExceptions", bFloatExceptions);
core->Set("DivByZeroExceptions", bDivideByZeroExceptions);
core->Set("FPRF", bFPRF);
core->Set("AccurateNaNs", bAccurateNaNs);
core->Set("SelectedLanguage", SelectedLanguage);
@ -509,6 +511,8 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("SyncGpuOverclock", &fSyncGpuOverclock, 1.0f);
core->Get("FastDiscSpeed", &bFastDiscSpeed, false);
core->Get("LowDCBZHack", &bLowDCBZHack, false);
core->Get("FloatExceptions", &bFloatExceptions, false);
core->Get("DivByZeroExceptions", &bDivideByZeroExceptions, false);
core->Get("FPRF", &bFPRF, false);
core->Get("AccurateNaNs", &bAccurateNaNs, false);
core->Get("DisableICache", &bDisableICache, false);
@ -747,6 +751,8 @@ void SConfig::LoadDefaults()
bRunCompareServer = false;
bDSPHLE = true;
bFastmem = true;
bFloatExceptions = false;
bDivideByZeroExceptions = false;
bFPRF = false;
bAccurateNaNs = false;
bDisableICache = false;