Explorar o código

Remove old, unused CPU optimization (#1586)

gdkchan %!s(int64=5) %!d(string=hai) anos
pai
achega
f2b12c9749

+ 0 - 2
ARMeilleure/Optimizations.cs

@@ -4,8 +4,6 @@ namespace ARMeilleure
 {
     public static class Optimizations
     {
-        public static bool AssumeStrictAbiCompliance { get; set; } = true;
-
         public static bool FastFP { get; set; } = true;
 
         public static bool UseSseIfAvailable       { get; set; } = true;

+ 4 - 38
ARMeilleure/Translation/RegisterUsage.cs

@@ -9,12 +9,6 @@ namespace ARMeilleure.Translation
 {
     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 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.
             RegisterMask[] localInputs  = new RegisterMask[cfg.Blocks.Count];
@@ -215,8 +209,8 @@ namespace ARMeilleure.Translation
 
                 if (EndsWithReturn(block) || hasContextStore)
                 {
-                    StoreLocals(block, globalOutputs[block.Index].IntMask, RegisterType.Integer, mode, isCompleteFunction);
-                    StoreLocals(block, globalOutputs[block.Index].VecMask, RegisterType.Vector,  mode, isCompleteFunction);
+                    StoreLocals(block, globalOutputs[block.Index].IntMask, RegisterType.Integer, mode);
+                    StoreLocals(block, globalOutputs[block.Index].VecMask, RegisterType.Vector,  mode);
                 }
             }
         }
@@ -309,20 +303,8 @@ namespace ARMeilleure.Translation
             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);
 
             Operation loadArg0 = Operation(Instruction.LoadArgument, arg0, Const(0));
@@ -396,21 +378,5 @@ namespace ARMeilleure.Translation
 
             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;
-        }
     }
 }

+ 1 - 1
ARMeilleure/Translation/Translator.cs

@@ -202,7 +202,7 @@ namespace ARMeilleure.Translation
 
             Logger.StartPass(PassName.RegisterUsage);
 
-            RegisterUsage.RunPass(cfg, mode, isCompleteFunction: false);
+            RegisterUsage.RunPass(cfg, mode);
 
             Logger.EndPass(PassName.RegisterUsage);