mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-11-22 17:56:59 +01:00
2502f1f07f
* Added support for offline invalidation, via PPTC, of low cq translations replaced by high cq translations; both on a single run and between runs. Added invalidation of .cache files in the event of reuse on a different user operating system. Added .info and .cache files invalidation in case of a failed stream decompression. Nits. * InternalVersion = 1712; * Nits. * Address comment. * Get rid of BinaryFormatter. Nits. * Move Ptc.LoadTranslations(). Nits. * Nits. * Fixed corner cases (in case backup copies have to be used). Added save logs. * Not core fixes. * Complement to the previous commit. Added load logs. Removed BinaryFormatter leftovers. * Add LoadTranslations log. * Nits. * Removed the search and management of LowCq overlapping functions. * Final increment of .info and .cache flags. * Nit. * Free up memory allocated by Pools during any PPTC translations at boot time. * Nit due to rebase.
105 lines
2.9 KiB
C#
105 lines
2.9 KiB
C#
using ARMeilleure.Common;
|
|
|
|
namespace ARMeilleure.IntermediateRepresentation
|
|
{
|
|
static class OperandHelper
|
|
{
|
|
private static MemoryOperand MemoryOperand()
|
|
{
|
|
return ThreadStaticPool<MemoryOperand>.Instance.Allocate();
|
|
}
|
|
|
|
private static Operand Operand()
|
|
{
|
|
return ThreadStaticPool<Operand>.Instance.Allocate();
|
|
}
|
|
|
|
public static Operand Const(OperandType type, long value)
|
|
{
|
|
return type == OperandType.I32 ? Operand().With((int)value) : Operand().With(value);
|
|
}
|
|
|
|
public static Operand Const(bool value)
|
|
{
|
|
return Operand().With(value ? 1 : 0);
|
|
}
|
|
|
|
public static Operand Const(int value)
|
|
{
|
|
return Operand().With(value);
|
|
}
|
|
|
|
public static Operand Const(uint value)
|
|
{
|
|
return Operand().With(value);
|
|
}
|
|
|
|
public static Operand Const(long value, bool relocatable = false, int? index = null)
|
|
{
|
|
return Operand().With(value, relocatable, index);
|
|
}
|
|
|
|
public static Operand Const(ulong value)
|
|
{
|
|
return Operand().With(value);
|
|
}
|
|
|
|
public static Operand ConstF(float value)
|
|
{
|
|
return Operand().With(value);
|
|
}
|
|
|
|
public static Operand ConstF(double value)
|
|
{
|
|
return Operand().With(value);
|
|
}
|
|
|
|
public static Operand Label()
|
|
{
|
|
return Operand().With(OperandKind.Label);
|
|
}
|
|
|
|
public static Operand Local(OperandType type)
|
|
{
|
|
return Operand().With(OperandKind.LocalVariable, type);
|
|
}
|
|
|
|
public static Operand Register(int index, RegisterType regType, OperandType type)
|
|
{
|
|
return Operand().With(index, regType, type);
|
|
}
|
|
|
|
public static Operand Undef()
|
|
{
|
|
return Operand().With(OperandKind.Undefined);
|
|
}
|
|
|
|
public static MemoryOperand MemoryOp(
|
|
OperandType type,
|
|
Operand baseAddress,
|
|
Operand index = null,
|
|
Multiplier scale = Multiplier.x1,
|
|
int displacement = 0)
|
|
{
|
|
return MemoryOperand().With(type, baseAddress, index, scale, displacement);
|
|
}
|
|
|
|
public static void PrepareOperandPool(bool highCq)
|
|
{
|
|
ThreadStaticPool<Operand>.PreparePool(highCq ? 1 : 0);
|
|
ThreadStaticPool<MemoryOperand>.PreparePool(highCq ? 1 : 0);
|
|
}
|
|
|
|
public static void ReturnOperandPool(bool highCq)
|
|
{
|
|
ThreadStaticPool<Operand>.ReturnPool(highCq ? 1 : 0);
|
|
ThreadStaticPool<MemoryOperand>.ReturnPool(highCq ? 1 : 0);
|
|
}
|
|
|
|
public static void ResetOperandPools()
|
|
{
|
|
ThreadStaticPool<Operand>.ResetPools();
|
|
ThreadStaticPool<MemoryOperand>.ResetPools();
|
|
}
|
|
}
|
|
}
|