Revert "mono-jit"

This reverts the mono jit PR.
It had several issues that I haven't had time to fix yet.
Expect mono jit v2 in the future with said fixes.

JitCache alignment fixes are still included/fixed.

Co-authored-by: LotP1 <68976644+LotP1@users.noreply.github.com>
This commit is contained in:
LotPandLotP1 authored and KeatonTheBot committed 2026-07-14 15:43:51 -05:00
1 parent 8b34270a22
commit 4b255a98db
8 files changed
+100 -85

No files matched your search

+32 -8
View File
@@ -19,22 +19,46 @@ namespace ARMeilleure.Common
new( 7, 8),
new( 1, 6)
];
private static readonly AddressTableLevel[] _monoSparse64Bit =
private static readonly AddressTableLevel[] _levels64BitSparseTiny =
[
new( 2, 37)
new( 11, 28),
new( 2, 9)
];
private static readonly AddressTableLevel[] _monoSparse32Bit =
private static readonly AddressTableLevel[] _levels32BitSparseTiny =
[
new( 1, 31)
new( 10, 22),
new( 1, 9)
];
public static AddressTableLevel[] GetArmPreset(bool for64Bits, bool sparse)
private static readonly AddressTableLevel[] _levels64BitSparseGiant =
[
new( 38, 1),
new( 2, 36)
];
private static readonly AddressTableLevel[] _levels32BitSparseGiant =
[
new( 31, 1),
new( 1, 30)
];
//high power will run worse on DDR3 systems and some DDR4 systems due to the higher ram utilization
//low power will never run worse than non-sparse, but for most systems it won't be necessary
//high power is always used, but I've left low power in here for future reference
public static AddressTableLevel[] GetArmPreset(bool for64Bits, bool sparse, bool lowPower = false)
{
if (sparse)
{
return for64Bits ? _monoSparse64Bit : _monoSparse32Bit;
if (lowPower)
{
return for64Bits ? _levels64BitSparseTiny : _levels32BitSparseTiny;
}
else
{
return for64Bits ? _levels64BitSparseGiant : _levels32BitSparseGiant;
}
}
else
{
@@ -5,7 +5,7 @@ using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.State;
using ARMeilleure.Translation;
using ARMeilleure.Translation.PTC;
using System.Linq;
using static ARMeilleure.Instructions.InstEmitHelper;
using static ARMeilleure.IntermediateRepresentation.Operand.Factory;
@@ -238,7 +238,7 @@ namespace ARMeilleure.Instructions
}
else if (table.Sparse)
{
// Inline table lookup. Only enabled when the sparse function table is enabled with 1 level.
// Inline table lookup. Only enabled when the sparse function table is enabled with 2 levels.
// Deliberately attempts to avoid branches.
Operand tableBase = !context.HasPtc ?
@@ -247,15 +247,18 @@ namespace ARMeilleure.Instructions
hostAddress = tableBase;
AddressTableLevel level = table.Levels.Last();
int clearBits = 64 - (level.Index + level.Length);
for (int i = 0; i < table.Levels.Length; i++)
{
AddressTableLevel level = table.Levels[i];
int clearBits = 64 - (level.Index + level.Length);
Operand index = context.ShiftLeft(
context.ShiftRightUI(context.ShiftLeft(guestAddress, Const(clearBits)), Const(clearBits + level.Index)),
Const(3)
);
Operand index = context.ShiftLeft(
context.ShiftRightUI(context.ShiftLeft(guestAddress, Const(clearBits)), Const(clearBits + level.Index)),
Const(3)
);
hostAddress = context.Load(OperandType.I64, context.Add(hostAddress, index));
hostAddress = context.Load(OperandType.I64, context.Add(hostAddress, index));
}
}
else
{
+1 -1
View File
@@ -32,7 +32,7 @@ namespace ARMeilleure.Translation.PTC
private const string OuterHeaderMagicString = "PTCohd\0\0";
private const string InnerHeaderMagicString = "PTCihd\0\0";
private const uint InternalVersion = 7018; //! To be incremented manually for each change to the ARMeilleure project.
private const uint InternalVersion = 7019; //! To be incremented manually for each change to the ARMeilleure project.
private const string ActualDir = "0";
private const string BackupDir = "1";
@@ -161,7 +161,7 @@ namespace ARMeilleure.Translation
context.BranchIfTrue(lblFallback, masked);
Operand index = default;
Operand page = Const(_functionTable.Base);
Operand page = Const((long)_functionTable.Base);
for (int i = 0; i < _functionTable.Levels.Length; i++)
{