2020-03-18 11:44:32 +00:00
|
|
|
|
using ARMeilleure.Common;
|
|
|
|
|
|
|
|
|
|
namespace ARMeilleure.IntermediateRepresentation
|
|
|
|
|
{
|
|
|
|
|
static class OperationHelper
|
|
|
|
|
{
|
|
|
|
|
public static Operation Operation()
|
|
|
|
|
{
|
|
|
|
|
return ThreadStaticPool<Operation>.Instance.Allocate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Operation Operation(Instruction instruction, Operand destination)
|
|
|
|
|
{
|
|
|
|
|
return Operation().With(instruction, destination);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Operation Operation(Instruction instruction, Operand destination,
|
|
|
|
|
Operand[] sources)
|
|
|
|
|
{
|
|
|
|
|
return Operation().With(instruction, destination, sources);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Operation Operation(Instruction instruction, Operand destination,
|
|
|
|
|
Operand source0)
|
|
|
|
|
{
|
|
|
|
|
return Operation().With(instruction, destination, source0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Operation Operation(Instruction instruction, Operand destination,
|
|
|
|
|
Operand source0, Operand source1)
|
|
|
|
|
{
|
|
|
|
|
return Operation().With(instruction, destination, source0, source1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Operation Operation(Instruction instruction, Operand destination,
|
|
|
|
|
Operand source0, Operand source1, Operand source2)
|
|
|
|
|
{
|
|
|
|
|
return Operation().With(instruction, destination, source0, source1, source2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Operation Operation(
|
|
|
|
|
Instruction instruction,
|
|
|
|
|
Operand[] destinations,
|
|
|
|
|
Operand[] sources)
|
|
|
|
|
{
|
|
|
|
|
return Operation().With(instruction, destinations, sources);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void PrepareOperationPool(bool highCq)
|
|
|
|
|
{
|
|
|
|
|
ThreadStaticPool<Operation>.PreparePool(highCq ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-24 02:58:36 +00:00
|
|
|
|
public static void ReturnOperationPool(bool highCq)
|
2020-03-18 11:44:32 +00:00
|
|
|
|
{
|
|
|
|
|
ThreadStaticPool<Operation>.ReturnPool(highCq ? 1 : 0);
|
|
|
|
|
}
|
2020-12-24 02:58:36 +00:00
|
|
|
|
|
|
|
|
|
public static void ResetOperationPools()
|
|
|
|
|
{
|
|
|
|
|
ThreadStaticPool<Operation>.ResetPools();
|
|
|
|
|
}
|
2020-03-18 11:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|