diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 5fa88d836a..25c7fca8ed 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -19,8 +19,6 @@ jobs: name: Windows Build runs-on: windows-latest timeout-minutes: 15 - env: - NUGET_ENABLE_LEGACY_CSPROJ_PACK: true steps: - name: Set net10.0 uses: actions/setup-dotnet@v5 @@ -62,10 +60,8 @@ jobs: run: nuget pack Source\Mosa.Packages\Mosa.Platform.x86.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }} - name: Create Package - Mosa.DeviceSystem run: nuget pack Source\Mosa.Packages\Mosa.DeviceSystem.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }} - - name: Build Project - Mosa.Templates - run: dotnet build Source\Mosa.Templates\Mosa.Templates.csproj - name: Create Package - Mosa.Templates - run: nuget pack Source\Mosa.Templates\Mosa.Templates.csproj -Tool -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }} + run: dotnet pack Source\Mosa.Templates\Mosa.Templates.csproj -o bin\nupkg /p:Version=${{ env.BUILD_VERSION }} - name: Store Nuget Packages Artifact uses: actions/upload-artifact@v6 with: @@ -89,8 +85,6 @@ jobs: runs-on: windows-latest timeout-minutes: 15 if: github.event_name == 'push' && github.repository == 'mosa/MOSA-Project' && github.ref == 'refs/heads/master' - env: - NUGET_ENABLE_LEGACY_CSPROJ_PACK: true steps: - name: Set net10.0 uses: actions/setup-dotnet@v5 diff --git a/Source/Data/IR-Optimizations-Useless.json b/Source/Data/IR-Optimizations-Useless.json index 4594ca70fc..ff61c48ec1 100644 --- a/Source/Data/IR-Optimizations-Useless.json +++ b/Source/Data/IR-Optimizations-Useless.json @@ -39,7 +39,7 @@ "SubName": "Double", "Expression": "IR.ZeroExtend8x32 (IR.ZeroExtend8x32 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move32 a)", + "Result": "(IR.ZeroExtend8x32 a)", "Priority": "85", "Variations": "No" }, @@ -49,7 +49,7 @@ "SubName": "Double", "Expression": "IR.ZeroExtend16x32 (IR.ZeroExtend16x32 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move32 a)", + "Result": "(IR.ZeroExtend16x32 a)", "Priority": "85", "Variations": "No" }, @@ -59,7 +59,7 @@ "SubName": "Double", "Expression": "IR.ZeroExtend8x64 (IR.ZeroExtend8x64 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move64 a)", + "Result": "(IR.ZeroExtend8x64 a)", "Priority": "85", "Variations": "No" }, @@ -69,7 +69,7 @@ "SubName": "Double", "Expression": "IR.ZeroExtend16x64 (IR.ZeroExtend16x64 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move64 a)", + "Result": "(IR.ZeroExtend16x64 a)", "Priority": "85", "Variations": "No" }, @@ -79,7 +79,7 @@ "SubName": "Double", "Expression": "IR.ZeroExtend32x64 (IR.ZeroExtend32x64 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move64 a)", + "Result": "(IR.ZeroExtend32x64 a)", "Priority": "85", "Variations": "No" }, @@ -89,7 +89,7 @@ "SubName": "Double", "Expression": "IR.SignExtend8x32 (IR.SignExtend8x32 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move32 a)", + "Result": "(IR.SignExtend8x32 a)", "Priority": "85", "Variations": "No" }, @@ -99,7 +99,7 @@ "SubName": "Double", "Expression": "IR.SignExtend16x32 (IR.SignExtend16x32 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move32 a)", + "Result": "(IR.SignExtend16x32 a)", "Priority": "85", "Variations": "No" }, @@ -109,7 +109,7 @@ "SubName": "Double", "Expression": "IR.SignExtend8x64 (IR.SignExtend8x64 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move64 a)", + "Result": "(IR.SignExtend8x64 a)", "Priority": "85", "Variations": "No" }, @@ -119,7 +119,7 @@ "SubName": "Double", "Expression": "IR.SignExtend16x64 (IR.SignExtend16x64 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move64 a)", + "Result": "(IR.SignExtend16x64 a)", "Priority": "85", "Variations": "No" }, @@ -129,7 +129,7 @@ "SubName": "Double", "Expression": "IR.SignExtend32x64 (IR.SignExtend32x64 a)", "Filter": "!IsConstant(a)", - "Result": "(IR.Move64 a)", + "Result": "(IR.SignExtend32x64 a)", "Priority": "85", "Variations": "No" }, diff --git a/Source/Docs/command-line-arguments.rst b/Source/Docs/command-line-arguments.rst index 5a09980b1e..43aca9bd88 100644 --- a/Source/Docs/command-line-arguments.rst +++ b/Source/Docs/command-line-arguments.rst @@ -24,6 +24,9 @@ Below are the command line arguments available: {none},Compiler.SourceFiles,{value} -o,Compiler.OutputFile,{value} + -path,SearchPaths,{list} + -postfix,FilePostfix,{value} + -threading,Compiler.Multithreading,true -threading-off,Compiler.Multithreading,false -threads,Compiler.Multithreading.MaxThreads,{value} @@ -31,7 +34,6 @@ Below are the command line arguments available: -base,Compiler.BaseAddress,{value} -scanner,Compiler.MethodScanner,true -no-code,Compiler.Binary,false - -path,SearchPaths,{list} -inline,Optimizations.Inline,true -inline-off,Optimizations.Inline,false @@ -206,7 +208,7 @@ Below are the command line arguments available: -bisect-pairwise-off,UnitTest.Bisector.Pairwise,false -bisect-disabled-file,UnitTest.Bisector.DisabledTransformsFile,{value} -bisect-state,UnitTest.Bisector.StateFile,{value} - -bisect-plan,UnitTest.Bisector.Plan,{value} (disable-one|enable-one|random-combo|failure-inducing|masking) + -bisect-plan,UnitTest.Bisector.Plan,{value} (disable-one|enable-one|random|failure-inducing|masking) -bisect-order,UnitTest.Bisector.Order,{value} -bisect-iterations,UnitTest.Bisector.Iterations,{value} -bisect-seed,UnitTest.Bisector.RandomSeed,{value} diff --git a/Source/Docs/settings-options.rst b/Source/Docs/settings-options.rst index f4b0b0940b..5b03a07e86 100644 --- a/Source/Docs/settings-options.rst +++ b/Source/Docs/settings-options.rst @@ -255,6 +255,7 @@ Common Settings :widths: 50, 200 DefaultFolder,Default folder for output files + FilePostfix,Postfix string appended to output file names SearchPaths,Folder to search for files TemporaryFolder,Specifies a temporary folder @@ -275,9 +276,9 @@ Unit Test Settings UnitTest.Bisector.Pairwise,"If true, enables pairwise bisector analysis mode" UnitTest.Bisector.DisabledTransformsFile,Path to a text file listing transform names to force-disable (one per line) during bisector runs UnitTest.Bisector.StateFile,Path to the bisector state file used to resume interrupted runs - UnitTest.Bisector.Plan,"Bisector plan: disable-one, enable-one, random-combo, failure-inducing, or masking" + UnitTest.Bisector.Plan,"Bisector plan: disable-one, enable-one, random, failure-inducing, or masking" UnitTest.Bisector.Order,"Iteration order for bisector plans: original, count, or random" - UnitTest.Bisector.Iterations,Number of random-combo iterations to execute per run + UnitTest.Bisector.Iterations,Number of random iterations to execute per run UnitTest.Bisector.RandomSeed,Optional random seed for deterministic random ordering/combinations (0 = auto) UnitTest.Bisector.ResetState,"If true, deletes existing state before starting" UnitTest.Bisector.WorkerIteration,"If true, executes only one bisector iteration per process run" diff --git a/Source/Docs/unit-tests.rst b/Source/Docs/unit-tests.rst index ffe2197948..490038d891 100644 --- a/Source/Docs/unit-tests.rst +++ b/Source/Docs/unit-tests.rst @@ -43,7 +43,7 @@ Supported plans: - ``-bisect-plan disable-one``: disable one transform at a time - ``-bisect-plan enable-one``: enable one transform at a time -- ``-bisect-plan random-combo``: randomly enable/disable all transforms each iteration (resumable) +- ``-bisect-plan random``: randomly enable/disable all transforms each iteration (resumable) - ``-bisect-plan failure-inducing``: bisect to identify transforms that induce failing runs - ``-bisect-plan masking``: bisect to identify transforms whose removal induces failures @@ -73,7 +73,7 @@ Optional ordering for deterministic plans: - ``-bisect-order count``: prioritize lower-observed transforms first - ``-bisect-order random``: randomized order (seeded via ``-bisect-seed``) -For ``random-combo``, use ``-bisect-iterations `` (default 20) to control how many iterations are run per invocation. +For ``random``, use ``-bisect-iterations `` (default 20) to control how many iterations are run per invocation. Supervisor ---------- diff --git a/Source/Mosa.Compiler.Framework/Analysis/SparseConditionalConstantPropagation.cs b/Source/Mosa.Compiler.Framework/Analysis/SparseConditionalConstantPropagation.cs index fe4a8870c4..8c813c5c11 100644 --- a/Source/Mosa.Compiler.Framework/Analysis/SparseConditionalConstantPropagation.cs +++ b/Source/Mosa.Compiler.Framework/Analysis/SparseConditionalConstantPropagation.cs @@ -945,7 +945,7 @@ private static bool IntegerOperation1(BaseInstruction instruction, ulong operand { if (instruction == IR.Neg32) { - result = (uint)-((int)operand1); + result = (ulong)(uint)-((int)operand1); return true; } else if (instruction == IR.Neg64) @@ -953,7 +953,12 @@ private static bool IntegerOperation1(BaseInstruction instruction, ulong operand result = (ulong)-((long)operand1); return true; } - else if (instruction == IR.Not32 || instruction == IR.Not64) + else if (instruction == IR.Not32) + { + result = (ulong)(uint)~operand1; + return true; + } + else if (instruction == IR.Not64) { result = ~operand1; return true; @@ -1021,59 +1026,104 @@ private void IntegerOperation2(Node node) private static bool IntegerOperation(BaseInstruction instruction, ulong operand1, ulong operand2, ConditionCode conditionCode, out ulong result) { - if (instruction == IR.Add32 - || instruction == IR.Add64) + if (instruction == IR.Add32) + { + result = (ulong)(uint)(operand1 + operand2); + return true; + } + else if (instruction == IR.Add64) { result = operand1 + operand2; return true; } - else if (instruction == IR.Sub32 - || instruction == IR.Sub64) + else if (instruction == IR.Sub32) + { + result = (ulong)(uint)(operand1 - operand2); + return true; + } + else if (instruction == IR.Sub64) { result = operand1 - operand2; return true; } - else if (instruction == IR.MulUnsigned32 - || instruction == IR.MulSigned32 - || instruction == IR.MulUnsigned64 - || instruction == IR.MulSigned64) + else if (instruction == IR.MulUnsigned32 || instruction == IR.MulSigned32) + { + result = (ulong)(uint)(operand1 * operand2); + return true; + } + else if (instruction == IR.MulUnsigned64 || instruction == IR.MulSigned64) { result = operand1 * operand2; return true; } - else if ((instruction == IR.DivUnsigned32 || instruction == IR.DivUnsigned64) && operand2 != 0) + else if (instruction == IR.DivUnsigned32 && operand2 != 0) + { + result = (ulong)((uint)operand1 / (uint)operand2); + return true; + } + else if (instruction == IR.DivUnsigned64 && operand2 != 0) { result = operand1 / operand2; return true; } - else if ((instruction == IR.DivSigned32 || instruction == IR.DivSigned64) && operand2 != 0) + else if (instruction == IR.DivSigned32 && operand2 != 0) + { + result = (ulong)(uint)((int)operand1 / (int)operand2); + return true; + } + else if (instruction == IR.DivSigned64 && operand2 != 0) { result = (ulong)((long)operand1 / (long)operand2); return true; } - else if ((instruction == IR.RemUnsigned32 || instruction == IR.RemUnsigned64) && operand2 != 0) + else if (instruction == IR.RemUnsigned32 && operand2 != 0) + { + result = (ulong)((uint)operand1 % (uint)operand2); + return true; + } + else if (instruction == IR.RemUnsigned64 && operand2 != 0) { result = operand1 % operand2; return true; } - else if ((instruction == IR.RemSigned32 || instruction == IR.RemSigned64) && operand2 != 0) + else if (instruction == IR.RemSigned32 && operand2 != 0) + { + result = (ulong)(uint)((int)operand1 % (int)operand2); + return true; + } + else if (instruction == IR.RemSigned64 && operand2 != 0) { result = (ulong)((long)operand1 % (long)operand2); return true; } - else if (instruction == IR.ArithShiftRight32 || instruction == IR.ArithShiftRight64) + else if (instruction == IR.ArithShiftRight32) + { + result = (ulong)(uint)((int)operand1 >> ((int)operand2 & 31)); + return true; + } + else if (instruction == IR.ArithShiftRight64) + { + result = (ulong)((long)operand1 >> ((int)operand2 & 63)); + return true; + } + else if (instruction == IR.ShiftRight32) + { + result = (ulong)((uint)operand1 >> ((int)operand2 & 31)); + return true; + } + else if (instruction == IR.ShiftRight64) { - result = (ulong)((long)operand1 >> (int)operand2); + result = operand1 >> ((int)operand2 & 63); return true; } - else if (instruction == IR.ShiftRight32 || instruction == IR.ShiftRight64) + else if (instruction == IR.ShiftLeft32) { - result = operand1 >> (int)operand2; + result = (ulong)(uint)((uint)operand1 << ((int)operand2 & 31)); return true; } - else if (instruction == IR.ShiftLeft32 || instruction == IR.ShiftLeft64) + else if (instruction == IR.ShiftLeft64) { - result = operand1 << (int)operand2; + result = operand1 << ((int)operand2 & 63); return true; } else if (instruction == IR.Compare32x32) diff --git a/Source/Mosa.Compiler.Framework/Stages/BaseTransformStage.cs b/Source/Mosa.Compiler.Framework/Stages/BaseTransformStage.cs index 2b2f741ea9..4288d0c7e7 100644 --- a/Source/Mosa.Compiler.Framework/Stages/BaseTransformStage.cs +++ b/Source/Mosa.Compiler.Framework/Stages/BaseTransformStage.cs @@ -46,19 +46,17 @@ protected override void Initialize() TransformCountStage = $"{Name}.Transforms"; OptimizationCountStage = $"{Name}.Optimizations"; - foreach (var list in transforms) + if (AllowTransformHooks) { - if (list == null) - continue; + foreach (var list in transforms) + { + if (list == null) + continue; - if (AllowTransformHooks) foreach (var transform in list) Compiler.CompilerHooks.RegisterTransform?.Invoke(Name, transform.Name); + } } - - if (AllowTransformHooks) - foreach (var transform in blockTransforms) - Compiler.CompilerHooks.RegisterTransform?.Invoke(Name, transform.Name); } protected override void Finish() @@ -286,12 +284,6 @@ private bool ApplyBlockTransforms() foreach (var transform in blockTransforms) { - if (AllowTransformHooks) - { - if (Compiler.CompilerHooks.IsTransformDisabled?.Invoke(Name, transform.Name) == true) - continue; - } - var count = transform.Process(Transform); var updated = count != 0; diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend16x32Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend16x32Double.cs index 98b73294fa..4f97e07dfb 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend16x32Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend16x32Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move32, result, t1); + context.SetInstruction(IR.SignExtend16x32, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend16x64Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend16x64Double.cs index 59b34740ca..86303bf3db 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend16x64Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend16x64Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move64, result, t1); + context.SetInstruction(IR.SignExtend16x64, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend32x64Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend32x64Double.cs index 4896ea71aa..73320788ab 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend32x64Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend32x64Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move64, result, t1); + context.SetInstruction(IR.SignExtend32x64, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend8x32Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend8x32Double.cs index df66aea898..76d365de93 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend8x32Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend8x32Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move32, result, t1); + context.SetInstruction(IR.SignExtend8x32, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend8x64Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend8x64Double.cs index 1ca3d2f780..a94393624f 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend8x64Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/SignExtend8x64Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move64, result, t1); + context.SetInstruction(IR.SignExtend8x64, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend16x32Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend16x32Double.cs index 01c8114c0b..4adb5ca7c7 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend16x32Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend16x32Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move32, result, t1); + context.SetInstruction(IR.ZeroExtend16x32, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend16x64Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend16x64Double.cs index 2ae074c381..254b9dab3f 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend16x64Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend16x64Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move64, result, t1); + context.SetInstruction(IR.ZeroExtend16x64, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend32x64Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend32x64Double.cs index 899416c7d6..4fd947a9a9 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend32x64Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend32x64Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move64, result, t1); + context.SetInstruction(IR.ZeroExtend32x64, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend8x32Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend8x32Double.cs index dabf9ac82a..dba19503cf 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend8x32Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend8x32Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move32, result, t1); + context.SetInstruction(IR.ZeroExtend8x32, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend8x64Double.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend8x64Double.cs index 08ade4e93d..91442ede7d 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend8x64Double.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Auto/Useless/ZeroExtend8x64Double.cs @@ -35,6 +35,6 @@ public override void Transform(Context context, Transform transform) var t1 = context.Operand1.Definitions[0].Operand1; - context.SetInstruction(IR.Move64, result, t1); + context.SetInstruction(IR.ZeroExtend8x64, result, t1); } } diff --git a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Manual/ManualTransforms.cs b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Manual/ManualTransforms.cs index fdb0f2465e..9a044210a2 100644 --- a/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Manual/ManualTransforms.cs +++ b/Source/Mosa.Compiler.Framework/Transforms/Optimizations/Manual/ManualTransforms.cs @@ -133,37 +133,37 @@ public static class ManualTransforms Memory.StoreLoadParam64.Instance, Memory.StoreLoadParamR4.Instance, Memory.StoreLoadParamR8.Instance, - Memory.StoreLoadParamObject.Instance, // Dup for MP + Memory.StoreLoadParamObject.Instance, // Duplicate for Managed Pointers Memory.LoadStoreParam32.Instance, Memory.LoadStoreParam64.Instance, Memory.LoadStoreParamR4.Instance, Memory.LoadStoreParamR8.Instance, - Memory.LoadStoreParamObject.Instance, // Dup for MP + Memory.LoadStoreParamObject.Instance, // Duplicate for Managed Pointers Memory.DoubleStoreParam32.Instance, Memory.DoubleStoreParam64.Instance, Memory.DoubleStoreParamR4.Instance, Memory.DoubleStoreParamR8.Instance, - Memory.DoubleStoreParamObject.Instance, // Dup for MP + Memory.DoubleStoreParamObject.Instance, // Duplicate for Managed Pointers Memory.LoadStore32.Instance, Memory.LoadStore64.Instance, Memory.LoadStoreR4.Instance, Memory.LoadStoreR8.Instance, - Memory.LoadStoreObject.Instance, // Dup for MP + Memory.LoadStoreObject.Instance, // Duplicate for Managed Pointers Memory.StoreLoad32.Instance, Memory.StoreLoad64.Instance, Memory.StoreLoadR4.Instance, Memory.StoreLoadR8.Instance, - Memory.StoreLoadObject.Instance, // Dup for MP + Memory.StoreLoadObject.Instance, // Duplicate for Managed Pointers Memory.DoubleStore32.Instance, Memory.DoubleStore64.Instance, Memory.DoubleStoreR4.Instance, Memory.DoubleStoreR8.Instance, - Memory.DoubleStoreObject.Instance, // Dup for MP + Memory.DoubleStoreObject.Instance, // Duplicate for Managed Pointers Memory.LoadZeroExtend16x32Store16.Instance, Memory.LoadZeroExtend16x64Store16.Instance, @@ -192,13 +192,13 @@ public static class ManualTransforms Memory.DoubleLoad64.Instance, Memory.DoubleLoadR4.Instance, Memory.DoubleLoadR8.Instance, - Memory.DoubleLoadParamObject.Instance, // Dup for MP + Memory.DoubleLoadParamObject.Instance, // Duplicate for Managed Pointers Memory.DoubleLoadParam32.Instance, Memory.DoubleLoadParam64.Instance, Memory.DoubleLoadParamR4.Instance, Memory.DoubleLoadParamR8.Instance, - Memory.DoubleLoadParamObject.Instance, // Dup for MP + Memory.DoubleLoadParamObject.Instance, // Duplicate for Managed Pointers Rewrite.Branch32GreaterOrEqualThanZero.Instance, Rewrite.Branch32LessThanZero.Instance, @@ -220,7 +220,7 @@ public static class ManualTransforms CodeMotion.Load64.Instance, CodeMotion.LoadR4.Instance, CodeMotion.LoadR8.Instance, - CodeMotion.LoadObject.Instance, // Dup for MP + CodeMotion.LoadObject.Instance, // Duplicate for Managed Pointers CodeMotion.LoadCompound.Instance, CodeMotion.LoadSignExtend16x32.Instance, diff --git a/Source/Mosa.Compiler.x64/Transforms/BaseIR/Compare32x32.cs b/Source/Mosa.Compiler.x64/Transforms/BaseIR/Compare32x32.cs index de135c9784..754d53c32d 100644 --- a/Source/Mosa.Compiler.x64/Transforms/BaseIR/Compare32x32.cs +++ b/Source/Mosa.Compiler.x64/Transforms/BaseIR/Compare32x32.cs @@ -18,13 +18,13 @@ private Compare32x32() : base(IR.Compare32x32, TransformType.Manual | TransformT public override void Transform(Context context, Transform transform) { var condition = context.ConditionCode; - var resultOperand = context.Result; + var result = context.Result; var operand1 = context.Operand1; var operand2 = context.Operand2; var v1 = transform.VirtualRegisters.Allocate32(); context.SetInstruction(X64.Cmp32, null, operand1, operand2); context.AppendInstruction(X64.Setcc, condition, v1); - context.AppendInstruction(X64.Movzx8To32, resultOperand, v1); + context.AppendInstruction(X64.Movzx8To32, result, v1); } } diff --git a/Source/Mosa.Compiler.x86/Transforms/Optimizations/Manual/Stack/Add32.cs b/Source/Mosa.Compiler.x86/Transforms/Optimizations/Manual/Stack/Add32.cs index 7c455b57fe..a50a1d036d 100644 --- a/Source/Mosa.Compiler.x86/Transforms/Optimizations/Manual/Stack/Add32.cs +++ b/Source/Mosa.Compiler.x86/Transforms/Optimizations/Manual/Stack/Add32.cs @@ -14,7 +14,6 @@ public sealed class Add32 : BaseTransform { public static readonly Add32 Instance = new(); - private Add32() : base(X86.Add32, TransformType.Manual | TransformType.Optimization) { } @@ -41,7 +40,7 @@ public override bool Match(Context context, Transform transform) if (next.Instruction != X86.Sub32) return false; - if (context.Operand1.Register != CPURegister.ESP) + if (next.Result.Register != CPURegister.ESP) return false; if (!next.Operand2.IsConstant) diff --git a/Source/Mosa.Tool.Bootstrap/Mosa.Tool.Bootstrap.csproj b/Source/Mosa.Tool.Bootstrap/Mosa.Tool.Bootstrap.csproj index 85233393f3..573302e73e 100644 --- a/Source/Mosa.Tool.Bootstrap/Mosa.Tool.Bootstrap.csproj +++ b/Source/Mosa.Tool.Bootstrap/Mosa.Tool.Bootstrap.csproj @@ -9,10 +9,10 @@ - - - - + + + + diff --git a/Source/Mosa.Tool.Explorer.Avalonia/Mosa.Tool.Explorer.Avalonia.csproj b/Source/Mosa.Tool.Explorer.Avalonia/Mosa.Tool.Explorer.Avalonia.csproj index f31578918b..f1844384c2 100755 --- a/Source/Mosa.Tool.Explorer.Avalonia/Mosa.Tool.Explorer.Avalonia.csproj +++ b/Source/Mosa.Tool.Explorer.Avalonia/Mosa.Tool.Explorer.Avalonia.csproj @@ -21,10 +21,10 @@ - + - - + + diff --git a/Source/Mosa.Tool.Launcher/Mosa.Tool.Launcher.csproj b/Source/Mosa.Tool.Launcher/Mosa.Tool.Launcher.csproj index c1aca8f0d6..b0a00825f0 100644 --- a/Source/Mosa.Tool.Launcher/Mosa.Tool.Launcher.csproj +++ b/Source/Mosa.Tool.Launcher/Mosa.Tool.Launcher.csproj @@ -14,10 +14,10 @@ - - - - + + + + diff --git a/Source/Mosa.Utility.Configuration/CommandLineArguments.cs b/Source/Mosa.Utility.Configuration/CommandLineArguments.cs index ccefb46934..a01f19b3cf 100644 --- a/Source/Mosa.Utility.Configuration/CommandLineArguments.cs +++ b/Source/Mosa.Utility.Configuration/CommandLineArguments.cs @@ -57,6 +57,8 @@ private static List GetMap() new Argument { Name = "-reduce-size", Setting = Name.Optimizations_ReduceCodeSize, Value = "true"}, new Argument { Name = "-scanwindow", Setting = Name.Optimizations_ScanWindow}, + new Argument { Name = "-postfix", Setting = Name.FilePostfix}, + // Compiler - Platforms: new Argument { Name = "-platform", Setting = Name.Compiler_Platform}, new Argument { Name = "-x86", Setting = Name.Compiler_Platform, Value = "x86"}, diff --git a/Source/Mosa.Utility.Configuration/MOSASettings.cs b/Source/Mosa.Utility.Configuration/MOSASettings.cs index 8fc7696ba9..1cb34b0d9e 100644 --- a/Source/Mosa.Utility.Configuration/MOSASettings.cs +++ b/Source/Mosa.Utility.Configuration/MOSASettings.cs @@ -350,6 +350,12 @@ public string NdisasmApp set => Settings.SetValue(Name.AppLocation_Ndisasm, value); } + public string FilePostfix + { + get => Settings.GetValue(Name.FilePostfix, null); + set => Settings.SetValue(Name.FilePostfix, value); + } + public string OutputFile { get => Settings.GetValue(Name.Compiler_OutputFile, null); @@ -1049,6 +1055,11 @@ public void ResolveFileAndPathSettings() baseFilename = "_mosa_"; } + if (!string.IsNullOrWhiteSpace(FilePostfix)) + { + baseFilename = $"{baseFilename}-{FilePostfix}"; + } + if (OutputFile is null or "%DEFAULT%") { OutputFile = Path.Combine(DefaultFolder, $"{baseFilename}.bin"); diff --git a/Source/Mosa.Utility.Configuration/Name.cs b/Source/Mosa.Utility.Configuration/Name.cs index d672be8850..d8520c75ea 100644 --- a/Source/Mosa.Utility.Configuration/Name.cs +++ b/Source/Mosa.Utility.Configuration/Name.cs @@ -123,8 +123,10 @@ public static class Name public const string BootLoaderTimeout = "BootLoader.Timeout"; + public const string FilePostfix = "FilePostfix"; public const string SearchPaths = "SearchPaths"; public const string TemporaryFolder = "TemporaryFolder"; + public const string UnitTest_Connection_MaxAttempts = "UnitTest.Connection.MaxAttempts"; public const string UnitTest_Connection_TimeOut = "UnitTest.Connection.TimeOut"; public const string UnitTest_Filter = "UnitTest.Filter"; diff --git a/Source/Mosa.Utility.UnitTestBisector/BisectorState.cs b/Source/Mosa.Utility.UnitTestBisector/BisectorState.cs index 7a2f574412..81d00653e4 100644 --- a/Source/Mosa.Utility.UnitTestBisector/BisectorState.cs +++ b/Source/Mosa.Utility.UnitTestBisector/BisectorState.cs @@ -32,6 +32,8 @@ internal sealed class BisectorState public List Results { get; set; } = []; + public List CurrentDisabledTransforms { get; set; } = []; + public bool Completed { get; set; } public string LastExitKind { get; set; } = Constant.ExitKindUnknown; diff --git a/Source/Mosa.Utility.UnitTestBisector/PlanKind.cs b/Source/Mosa.Utility.UnitTestBisector/PlanKind.cs index 10a6d51b5a..f6aba48f07 100644 --- a/Source/Mosa.Utility.UnitTestBisector/PlanKind.cs +++ b/Source/Mosa.Utility.UnitTestBisector/PlanKind.cs @@ -6,7 +6,7 @@ internal enum PlanKind { DisableOne, EnableOne, - RandomCombo, + Random, FailureInducing, Masking, } diff --git a/Source/Mosa.Utility.UnitTestBisector/UnitTestBisectorSystem.cs b/Source/Mosa.Utility.UnitTestBisector/UnitTestBisectorSystem.cs index 1dd43e51cf..11d77e1782 100644 --- a/Source/Mosa.Utility.UnitTestBisector/UnitTestBisectorSystem.cs +++ b/Source/Mosa.Utility.UnitTestBisector/UnitTestBisectorSystem.cs @@ -129,7 +129,7 @@ public int Start(string[] args) OutputStatusBisector($"Loaded transforms from state: {state.Transforms.Count}"); } - return plan == PlanKind.RandomCombo + return plan == PlanKind.Random ? ExecuteRandomComboPlan(stateFile, state, discoveredUnitTests) : ExecuteDeterministicPlan(stateFile, state, plan, discoveredUnitTests); } @@ -488,7 +488,7 @@ private int ExecuteRandomComboPlan(string stateFile, BisectorState state, List discoveredUnitTests) { + state.CurrentDisabledTransforms = effectiveDisabledTransformNames.OrderBy(x => x).ToList(); SaveState(stateFile, state); using var assertCapture = new AssertCaptureScope(); @@ -753,10 +754,10 @@ private static PlanKind ParsePlan(string plan) { "enable-one" => PlanKind.EnableOne, "disable-one" => PlanKind.DisableOne, - "random-combo" => PlanKind.RandomCombo, + "random" => PlanKind.Random, "failure-inducing" => PlanKind.FailureInducing, "masking" => PlanKind.Masking, - _ => throw new InvalidOperationException($"Unknown plan '{plan}'. Valid values: disable-one, enable-one, random-combo, failure-inducing, masking."), + _ => throw new InvalidOperationException($"Unknown plan '{plan}'. Valid values: disable-one, enable-one, random, failure-inducing, masking."), }; } diff --git a/Tools/qemu/VERSION b/Tools/qemu/VERSION index 994e128216..e12cd6be0f 100644 --- a/Tools/qemu/VERSION +++ b/Tools/qemu/VERSION @@ -1 +1 @@ -10.2.94 +11.0.50 diff --git a/Tools/qemu/libSvtAv1Enc-4.dll b/Tools/qemu/libSvtAv1Enc-4.dll index 14a29e7706..89009007ba 100644 Binary files a/Tools/qemu/libSvtAv1Enc-4.dll and b/Tools/qemu/libSvtAv1Enc-4.dll differ diff --git a/Tools/qemu/libatk-1.0-0.dll b/Tools/qemu/libatk-1.0-0.dll index 61668424a2..408d481f76 100644 Binary files a/Tools/qemu/libatk-1.0-0.dll and b/Tools/qemu/libatk-1.0-0.dll differ diff --git a/Tools/qemu/libavif-16.dll b/Tools/qemu/libavif-16.dll index a2272fb23a..a3ce94c215 100644 Binary files a/Tools/qemu/libavif-16.dll and b/Tools/qemu/libavif-16.dll differ diff --git a/Tools/qemu/libcrypto-3-x64.dll b/Tools/qemu/libcrypto-3-x64.dll index b67a9b5470..88fee33526 100644 Binary files a/Tools/qemu/libcrypto-3-x64.dll and b/Tools/qemu/libcrypto-3-x64.dll differ diff --git a/Tools/qemu/libcurl-4.dll b/Tools/qemu/libcurl-4.dll index 4bbf71f301..c2f9c788a9 100644 Binary files a/Tools/qemu/libcurl-4.dll and b/Tools/qemu/libcurl-4.dll differ diff --git a/Tools/qemu/libexpat-1.dll b/Tools/qemu/libexpat-1.dll index a0a3ee50de..127e577959 100644 Binary files a/Tools/qemu/libexpat-1.dll and b/Tools/qemu/libexpat-1.dll differ diff --git a/Tools/qemu/libfeature_support.dll b/Tools/qemu/libfeature_support.dll new file mode 100644 index 0000000000..ab0784a460 Binary files /dev/null and b/Tools/qemu/libfeature_support.dll differ diff --git a/Tools/qemu/libgcc_s_seh-1.dll b/Tools/qemu/libgcc_s_seh-1.dll index 811016dcfe..ab9b19d191 100644 Binary files a/Tools/qemu/libgcc_s_seh-1.dll and b/Tools/qemu/libgcc_s_seh-1.dll differ diff --git a/Tools/qemu/libgnutls-30.dll b/Tools/qemu/libgnutls-30.dll index f05afe4945..4d46f26b78 100644 Binary files a/Tools/qemu/libgnutls-30.dll and b/Tools/qemu/libgnutls-30.dll differ diff --git a/Tools/qemu/libharfbuzz-0.dll b/Tools/qemu/libharfbuzz-0.dll index 884615a548..bd7c8eb8c5 100644 Binary files a/Tools/qemu/libharfbuzz-0.dll and b/Tools/qemu/libharfbuzz-0.dll differ diff --git a/Tools/qemu/libhwy.dll b/Tools/qemu/libhwy.dll index dcc3e5559d..cbd9a647e4 100644 Binary files a/Tools/qemu/libhwy.dll and b/Tools/qemu/libhwy.dll differ diff --git a/Tools/qemu/libjsoncpp-26.dll b/Tools/qemu/libjsoncpp-26.dll new file mode 100644 index 0000000000..a68a5d82e0 Binary files /dev/null and b/Tools/qemu/libjsoncpp-26.dll differ diff --git a/Tools/qemu/libjxl.dll b/Tools/qemu/libjxl.dll index c3e4b89c11..731b920602 100644 Binary files a/Tools/qemu/libjxl.dll and b/Tools/qemu/libjxl.dll differ diff --git a/Tools/qemu/libjxl_cms.dll b/Tools/qemu/libjxl_cms.dll index 22274bd7f2..44ce5e0b63 100644 Binary files a/Tools/qemu/libjxl_cms.dll and b/Tools/qemu/libjxl_cms.dll differ diff --git a/Tools/qemu/liblcms2-2.dll b/Tools/qemu/liblcms2-2.dll index af54abd11c..2e20156203 100644 Binary files a/Tools/qemu/liblcms2-2.dll and b/Tools/qemu/liblcms2-2.dll differ diff --git a/Tools/qemu/libpng16-16.dll b/Tools/qemu/libpng16-16.dll index 4721fa7208..5f090710a9 100644 Binary files a/Tools/qemu/libpng16-16.dll and b/Tools/qemu/libpng16-16.dll differ diff --git a/Tools/qemu/libssl-3-x64.dll b/Tools/qemu/libssl-3-x64.dll index 4faf44bc20..1c34877080 100644 Binary files a/Tools/qemu/libssl-3-x64.dll and b/Tools/qemu/libssl-3-x64.dll differ diff --git a/Tools/qemu/libstdc++-6.dll b/Tools/qemu/libstdc++-6.dll index 646fbd1c67..ac585b8a15 100644 Binary files a/Tools/qemu/libstdc++-6.dll and b/Tools/qemu/libstdc++-6.dll differ diff --git a/Tools/qemu/libunistring-5.dll b/Tools/qemu/libunistring-5.dll index 77d8873321..7e16cd8b3b 100644 Binary files a/Tools/qemu/libunistring-5.dll and b/Tools/qemu/libunistring-5.dll differ diff --git a/Tools/qemu/libvirglrenderer-1.dll b/Tools/qemu/libvirglrenderer-1.dll index ff6d88a32f..a93a43381b 100644 Binary files a/Tools/qemu/libvirglrenderer-1.dll and b/Tools/qemu/libvirglrenderer-1.dll differ diff --git a/Tools/qemu/qemu-img.exe b/Tools/qemu/qemu-img.exe index 1358ba0506..31c5f24e51 100755 Binary files a/Tools/qemu/qemu-img.exe and b/Tools/qemu/qemu-img.exe differ diff --git a/Tools/qemu/qemu-nbd.exe b/Tools/qemu/qemu-nbd.exe index 2ad712ff9a..85d9f0fbd6 100755 Binary files a/Tools/qemu/qemu-nbd.exe and b/Tools/qemu/qemu-nbd.exe differ diff --git a/Tools/qemu/qemu-system-aarch64.exe b/Tools/qemu/qemu-system-aarch64.exe index a55d61487e..b955620471 100755 Binary files a/Tools/qemu/qemu-system-aarch64.exe and b/Tools/qemu/qemu-system-aarch64.exe differ diff --git a/Tools/qemu/qemu-system-arm.exe b/Tools/qemu/qemu-system-arm.exe index 19e33cb490..332b6a2520 100755 Binary files a/Tools/qemu/qemu-system-arm.exe and b/Tools/qemu/qemu-system-arm.exe differ diff --git a/Tools/qemu/qemu-system-i386.exe b/Tools/qemu/qemu-system-i386.exe index 052125f38c..7408b73161 100755 Binary files a/Tools/qemu/qemu-system-i386.exe and b/Tools/qemu/qemu-system-i386.exe differ diff --git a/Tools/qemu/qemu-system-x86_64.exe b/Tools/qemu/qemu-system-x86_64.exe index 0828bdc979..a0eb023f4a 100755 Binary files a/Tools/qemu/qemu-system-x86_64.exe and b/Tools/qemu/qemu-system-x86_64.exe differ diff --git a/Tools/reduce-qemu.bat b/Tools/reduce-qemu.bat index 57858fcd93..92d09a849f 100644 --- a/Tools/reduce-qemu.bat +++ b/Tools/reduce-qemu.bat @@ -1,7 +1,7 @@ mkdir %temp%\MOSA del /Q %temp%\MOSA\qemu-installer.exe -curl https://qemu.weilnetz.de/w64/qemu-w64-setup-20260416.exe --output %temp%\MOSA\qemu-installer.exe +curl https://qemu.weilnetz.de/w64/qemu-w64-setup-20260501.exe --output %temp%\MOSA\qemu-installer.exe del /S /Q qemu 7zip\7z.exe x -wqemu -oqemu -x!*.nsis -y %temp%\MOSA\qemu-installer.exe @@ -85,3 +85,7 @@ del /S /Q qemu\share\dtb\pegasos2.dtb del /S /Q qemu\share\u-boot-sam460.bin del /S /Q qemu\share\hppa-firmware64.img del /S /Q qemu\share\hppa-firmware.img +del /S /Q qemu\libEGL*.dll +del /S /Q qemu\libGLES*.dll +del /S /Q qemu\libVk*.dll +del /S /Q qemu\share\u-boot-sam460.bin