mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-23 16:35:31 +00:00
Remove old, unused CPU optimization (#1586)
This commit is contained in:
parent
26319d5ab3
commit
f2b12c9749
|
@ -4,8 +4,6 @@ namespace ARMeilleure
|
||||||
{
|
{
|
||||||
public static class Optimizations
|
public static class Optimizations
|
||||||
{
|
{
|
||||||
public static bool AssumeStrictAbiCompliance { get; set; } = true;
|
|
||||||
|
|
||||||
public static bool FastFP { get; set; } = true;
|
public static bool FastFP { get; set; } = true;
|
||||||
|
|
||||||
public static bool UseSseIfAvailable { get; set; } = true;
|
public static bool UseSseIfAvailable { get; set; } = true;
|
||||||
|
|
|
@ -9,12 +9,6 @@ namespace ARMeilleure.Translation
|
||||||
{
|
{
|
||||||
static class RegisterUsage
|
static class RegisterUsage
|
||||||
{
|
{
|
||||||
private const long CallerSavedIntRegistersMask = 0x7fL << 9;
|
|
||||||
private const long PStateNzcvFlagsMask = 0xfL << 60;
|
|
||||||
private const long FpStateNzcvFlagsMask = 0xfL << 60;
|
|
||||||
|
|
||||||
private const long CallerSavedVecRegistersMask = 0xffffL << 16;
|
|
||||||
|
|
||||||
private const int RegsCount = 32;
|
private const int RegsCount = 32;
|
||||||
private const int RegsMask = RegsCount - 1;
|
private const int RegsMask = RegsCount - 1;
|
||||||
|
|
||||||
|
@ -70,7 +64,7 @@ namespace ARMeilleure.Translation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RunPass(ControlFlowGraph cfg, ExecutionMode mode, bool isCompleteFunction)
|
public static void RunPass(ControlFlowGraph cfg, ExecutionMode mode)
|
||||||
{
|
{
|
||||||
// Compute local register inputs and outputs used inside blocks.
|
// Compute local register inputs and outputs used inside blocks.
|
||||||
RegisterMask[] localInputs = new RegisterMask[cfg.Blocks.Count];
|
RegisterMask[] localInputs = new RegisterMask[cfg.Blocks.Count];
|
||||||
|
@ -215,8 +209,8 @@ namespace ARMeilleure.Translation
|
||||||
|
|
||||||
if (EndsWithReturn(block) || hasContextStore)
|
if (EndsWithReturn(block) || hasContextStore)
|
||||||
{
|
{
|
||||||
StoreLocals(block, globalOutputs[block.Index].IntMask, RegisterType.Integer, mode, isCompleteFunction);
|
StoreLocals(block, globalOutputs[block.Index].IntMask, RegisterType.Integer, mode);
|
||||||
StoreLocals(block, globalOutputs[block.Index].VecMask, RegisterType.Vector, mode, isCompleteFunction);
|
StoreLocals(block, globalOutputs[block.Index].VecMask, RegisterType.Vector, mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,20 +303,8 @@ namespace ARMeilleure.Translation
|
||||||
block.Operations.AddFirst(loadArg0);
|
block.Operations.AddFirst(loadArg0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void StoreLocals(BasicBlock block, long outputs, RegisterType baseType, ExecutionMode mode, bool isCompleteFunction)
|
private static void StoreLocals(BasicBlock block, long outputs, RegisterType baseType, ExecutionMode mode)
|
||||||
{
|
{
|
||||||
if (Optimizations.AssumeStrictAbiCompliance && isCompleteFunction)
|
|
||||||
{
|
|
||||||
if (baseType == RegisterType.Integer || baseType == RegisterType.Flag)
|
|
||||||
{
|
|
||||||
outputs = ClearCallerSavedIntRegs(outputs);
|
|
||||||
}
|
|
||||||
else /* if (baseType == RegisterType.Vector || baseType == RegisterType.FpFlag) */
|
|
||||||
{
|
|
||||||
outputs = ClearCallerSavedVecRegs(outputs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Operand arg0 = Local(OperandType.I64);
|
Operand arg0 = Local(OperandType.I64);
|
||||||
|
|
||||||
Operation loadArg0 = Operation(Instruction.LoadArgument, arg0, Const(0));
|
Operation loadArg0 = Operation(Instruction.LoadArgument, arg0, Const(0));
|
||||||
|
@ -396,21 +378,5 @@ namespace ARMeilleure.Translation
|
||||||
|
|
||||||
return operation.Instruction == Instruction.Return;
|
return operation.Instruction == Instruction.Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static long ClearCallerSavedIntRegs(long mask)
|
|
||||||
{
|
|
||||||
// TODO: ARM32 support.
|
|
||||||
mask &= ~(CallerSavedIntRegistersMask | PStateNzcvFlagsMask);
|
|
||||||
|
|
||||||
return mask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static long ClearCallerSavedVecRegs(long mask)
|
|
||||||
{
|
|
||||||
// TODO: ARM32 support.
|
|
||||||
mask &= ~(CallerSavedVecRegistersMask | FpStateNzcvFlagsMask);
|
|
||||||
|
|
||||||
return mask;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -202,7 +202,7 @@ namespace ARMeilleure.Translation
|
||||||
|
|
||||||
Logger.StartPass(PassName.RegisterUsage);
|
Logger.StartPass(PassName.RegisterUsage);
|
||||||
|
|
||||||
RegisterUsage.RunPass(cfg, mode, isCompleteFunction: false);
|
RegisterUsage.RunPass(cfg, mode);
|
||||||
|
|
||||||
Logger.EndPass(PassName.RegisterUsage);
|
Logger.EndPass(PassName.RegisterUsage);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue