-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - WIP - ARMv8A32 * - WIP - ARMv8A32 * - Updated builds.yml * - Updated builds.yml * - Updated builds.yml * - Updated builds.yml * - WIP - x64 * More BareMetal changes * Update Mosa.Kernel.x86.ConsolePlug * Fix IDT issue * - WIP * - WIP --------- Co-authored-by: AnErrupTion <anerruption@disroot.org>
- Loading branch information
1 parent
2dd0ddb
commit 8cdde18
Showing
17 changed files
with
216 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) MOSA Project. Licensed under the New BSD License. | ||
|
||
using Mosa.Compiler.Framework; | ||
|
||
namespace Mosa.Platform.x64.Intrinsic; | ||
|
||
/// <summary> | ||
/// IntrinsicMethods | ||
/// </summary> | ||
internal static partial class IntrinsicMethods | ||
{ | ||
[IntrinsicMethod("Mosa.Platform.x64.Intrinsic::XAddLoad32")] | ||
private static void XAddLoad32(Context context, TransformContext transformContext) | ||
{ | ||
var location = context.Operand1; | ||
var value = context.Operand2; | ||
var result = context.Result; | ||
|
||
var v1 = transformContext.VirtualRegisters.Allocate64(); | ||
|
||
context.SetInstruction(X64.Mov32, v1, value); | ||
context.AppendInstruction(X64.Lock); | ||
context.AppendInstruction(X64.XAddLoad32, v1, location, Operand.Constant32_0, v1); | ||
context.AppendInstruction(X64.Mov32, result, v1); | ||
} | ||
} |
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,26 @@ | ||
// Copyright (c) MOSA Project. Licensed under the New BSD License. | ||
|
||
using Mosa.Compiler.Framework; | ||
|
||
namespace Mosa.Platform.x64.Intrinsic; | ||
|
||
/// <summary> | ||
/// IntrinsicMethods | ||
/// </summary> | ||
internal static partial class IntrinsicMethods | ||
{ | ||
[IntrinsicMethod("Mosa.Platform.x64.Intrinsic::XChgLoad32")] | ||
private static void XChgLoad32(Context context, TransformContext transformContext) | ||
{ | ||
var location = context.Operand1; | ||
var value = context.Operand2; | ||
var result = context.Result; | ||
|
||
var v1 = transformContext.VirtualRegisters.Allocate64(); | ||
|
||
context.SetInstruction(X64.Mov32, v1, value); | ||
context.AppendInstruction(X64.Lock); | ||
context.AppendInstruction(X64.XChgLoad32, v1, location, Operand.Constant32_0, v1); | ||
context.AppendInstruction(X64.Mov32, result, v1); | ||
} | ||
} |
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,57 @@ | ||
// Copyright (c) MOSA Project. Licensed under the New BSD License. | ||
|
||
using Mosa.Runtime.Plug; | ||
using Mosa.Runtime.x64; | ||
|
||
namespace Mosa.Plug.Korlib.System.x64; | ||
|
||
internal static class Math | ||
{ | ||
//[Plug("System.Math::Abs")] | ||
//internal static double Abs(double value) | ||
//{ | ||
// return 0; // TODO | ||
//} | ||
|
||
//[Plug("System.Math::Abs")] | ||
//internal static float Abs(float value) | ||
//{ | ||
// return 0; // TODO | ||
//} | ||
|
||
[Plug("System.Math::Sqrt")] | ||
internal static double Sqrt(double d) | ||
{ | ||
return Native.Sqrtsd(d); | ||
} | ||
|
||
[Plug("System.Math::Ceiling")] | ||
internal static double Ceiling(double d) | ||
{ | ||
return Native.Roundsd2Positive(d); | ||
} | ||
|
||
[Plug("System.Math::Floor")] | ||
internal static double Floor(double d) | ||
{ | ||
return Native.Roundsd2Negative(d); | ||
} | ||
|
||
//[Plug("System.Math::Log")] | ||
//internal static double Log(double d) | ||
//{ | ||
// return 0; // TODO | ||
//} | ||
|
||
//[Plug("System.Math::FMod")] | ||
//internal static double FMod(double x, double y) | ||
//{ | ||
// return 0; // TODO | ||
//} | ||
|
||
//[Plug("System.Math::ModF")] | ||
//internal static unsafe double ModF(double x, double* intptr) | ||
//{ | ||
// return 0; // TODO | ||
//} | ||
} |
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,45 @@ | ||
// Copyright (c) MOSA Project. Licensed under the New BSD License. | ||
|
||
using Mosa.Runtime.Plug; | ||
using Mosa.Runtime.x64; | ||
|
||
namespace Mosa.Plug.Korlib.System.x64; | ||
|
||
internal static class MathF | ||
{ | ||
[Plug("System.MathF::Ceiling")] | ||
internal static float Ceiling(float s) | ||
{ | ||
return Native.Roundss2Positive(s); | ||
} | ||
|
||
[Plug("System.MathF::Sqrt")] | ||
internal static float Sqrt(float s) | ||
{ | ||
return Native.Sqrtss(s); | ||
} | ||
|
||
[Plug("System.MathF::Floor")] | ||
internal static float Floor(float s) | ||
{ | ||
return Native.Roundss2Negative(s); | ||
} | ||
|
||
//[Plug("System.MathF::Log")] | ||
//internal static float Log(float s) | ||
//{ | ||
// return 0; // TODO | ||
//} | ||
|
||
//[Plug("System.MathF::FMod")] | ||
//internal static float FMod(float x, float y) | ||
//{ | ||
// return 0; // TODO | ||
//} | ||
|
||
//[Plug("System.MathF::ModF")] | ||
//internal static unsafe float ModF(float x, float* intptr) | ||
//{ | ||
// return 0; // TODO | ||
//} | ||
} |
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