forked from mosa/MOSA-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
10 changed files
with
149 additions
and
27 deletions.
There are no files selected for viewing
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
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,41 @@ | ||
/* | ||
* (c) 2008 MOSA - The Managed Operating System Alliance | ||
* | ||
* Licensed under the terms of the New BSD License. | ||
* | ||
* Authors: | ||
* Simon Wollwage (rootnode) <[email protected]> | ||
*/ | ||
|
||
using Mosa.Compiler.Framework; | ||
using System.Diagnostics; | ||
|
||
namespace Mosa.Platform.x86.Intrinsic | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
internal sealed class Get16 : IIntrinsicPlatformMethod | ||
{ | ||
#region Methods | ||
|
||
/// <summary> | ||
/// Replaces the intrinsic call site | ||
/// </summary> | ||
/// <param name="context">The context.</param> | ||
/// <param name="typeSystem">The type system.</param> | ||
void IIntrinsicPlatformMethod.ReplaceIntrinsicCall(Context context, BaseMethodCompiler methodCompiler) | ||
{ | ||
Operand result = context.Result; | ||
Operand v1 = methodCompiler.CreateVirtualRegister(methodCompiler.TypeSystem.BuiltIn.Pointer); | ||
Operand operand = Operand.CreateMemoryAddress(methodCompiler.TypeSystem.BuiltIn.U2, v1, 0); | ||
|
||
Debug.Assert(result.IsI4 | result.IsU4); | ||
|
||
context.SetInstruction(X86.Mov, v1, context.Operand1); | ||
context.AppendInstruction(X86.Movzx, InstructionSize.Size16, result, operand); | ||
} | ||
|
||
#endregion Methods | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* (c) 2008 MOSA - The Managed Operating System Alliance | ||
* | ||
* Licensed under the terms of the New BSD License. | ||
* | ||
* Authors: | ||
* Simon Wollwage (rootnode) <[email protected]> | ||
*/ | ||
|
||
using Mosa.Compiler.Framework; | ||
|
||
namespace Mosa.Platform.x86.Intrinsic | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
internal sealed class Get8 : IIntrinsicPlatformMethod | ||
{ | ||
#region Methods | ||
|
||
/// <summary> | ||
/// Replaces the intrinsic call site | ||
/// </summary> | ||
/// <param name="context">The context.</param> | ||
/// <param name="typeSystem">The type system.</param> | ||
void IIntrinsicPlatformMethod.ReplaceIntrinsicCall(Context context, BaseMethodCompiler methodCompiler) | ||
{ | ||
Operand result = context.Result; | ||
Operand v1 = methodCompiler.CreateVirtualRegister(methodCompiler.TypeSystem.BuiltIn.Pointer); | ||
Operand operand = Operand.CreateMemoryAddress(methodCompiler.TypeSystem.BuiltIn.U1, v1, 0); | ||
|
||
context.SetInstruction(X86.Mov, v1, context.Operand1); | ||
context.AppendInstruction(X86.Movzx, InstructionSize.Size8, result, operand); | ||
} | ||
|
||
#endregion Methods | ||
} | ||
} |
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