CPU: Add low-power PPTC load mode.

Specifically, this setting causes the translation load core count to get reduced by two-thirds, for lower-power but still fast loading, and for unstable CPUs.
This commit is contained in:
Evan Husted 2024-10-14 21:48:21 -05:00
parent 4ee1dff497
commit 0faf3f5709
10 changed files with 60 additions and 32 deletions

View file

@ -5,6 +5,9 @@ namespace ARMeilleure
public static class Optimizations
{
// low-core count PPTC
public static bool EcoFriendly { get; set; } = false;
public static bool FastFP { get; set; } = true;
public static bool AllowLcqInFunctionTable { get; set; } = true;

View file

@ -795,10 +795,15 @@ namespace ARMeilleure.Translation.PTC
return;
}
int degreeOfParallelism = Environment.ProcessorCount;
if (Optimizations.EcoFriendly)
degreeOfParallelism /= 3;
// If there are enough cores lying around, we leave one alone for other tasks.
if (degreeOfParallelism > 4)
if (degreeOfParallelism > 4 && !Optimizations.EcoFriendly)
{
degreeOfParallelism--;
}