forked from mosa/MOSA-Project
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
492 additions
and
234 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
Source/Mosa.Compiler.x64/Transforms/Optimizations/Manual/Rewrite/Add32ToInc32.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
Source/Mosa.Compiler.x64/Transforms/Optimizations/Manual/Rewrite/Lea32ToDec32.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
Source/Mosa.Compiler.x64/Transforms/Optimizations/Manual/Rewrite/Lea32ToInc32.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Source/Mosa.Compiler.x64/Transforms/Optimizations/Manual/Rewrite/Lea32ToMov32.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) MOSA Project. Licensed under the New BSD License. | ||
|
||
using Mosa.Compiler.Framework; | ||
|
||
namespace Mosa.Compiler.x64.Transforms.Optimizations.Manual.Rewrite; | ||
|
||
[Transform("x64.Optimizations.Manual.Rewrite")] | ||
public sealed class Lea32ToMov32 : BaseTransform | ||
{ | ||
public Lea32ToMov32() : base(X64.Lea32, TransformType.Manual | TransformType.Optimization) | ||
{ | ||
} | ||
|
||
public override bool Match(Context context, Transform transform) | ||
{ | ||
if (!context.Operand2.IsResolvedConstant) | ||
return false; | ||
|
||
if (!context.Operand2.IsConstantZero) | ||
return false; | ||
|
||
return true; | ||
} | ||
|
||
public override void Transform(Context context, Transform transform) | ||
{ | ||
var result = context.Result; | ||
var operand1 = context.Operand1; | ||
|
||
context.SetInstruction(X64.Mov32, result, operand1); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Source/Mosa.Compiler.x64/Transforms/Optimizations/Manual/Rewrite/Lea64ToMov64.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) MOSA Project. Licensed under the New BSD License. | ||
|
||
using Mosa.Compiler.Framework; | ||
|
||
namespace Mosa.Compiler.x64.Transforms.Optimizations.Manual.Rewrite; | ||
|
||
[Transform("x64.Optimizations.Manual.Rewrite")] | ||
public sealed class Lea64ToMov64 : BaseTransform | ||
{ | ||
public Lea64ToMov64() : base(X64.Lea64, TransformType.Manual | TransformType.Optimization) | ||
{ | ||
} | ||
|
||
public override bool Match(Context context, Transform transform) | ||
{ | ||
if (!context.Operand2.IsResolvedConstant) | ||
return false; | ||
|
||
if (!context.Operand2.IsConstantZero) | ||
return false; | ||
|
||
return true; | ||
} | ||
|
||
public override void Transform(Context context, Transform transform) | ||
{ | ||
var result = context.Result; | ||
var operand1 = context.Operand1; | ||
|
||
context.SetInstruction(X64.Mov64, result, operand1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
Source/Mosa.Compiler.x64/Transforms/Optimizations/Manual/Rewrite/Sub32ToDec32.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.