2023-12-04 14:17:13 +01:00
|
|
|
using ARMeilleure.Decoders;
|
2020-07-13 12:48:14 +02:00
|
|
|
using ARMeilleure.IntermediateRepresentation;
|
|
|
|
using ARMeilleure.Translation;
|
|
|
|
using static ARMeilleure.Instructions.InstEmitHashHelper;
|
2023-03-04 14:43:08 +01:00
|
|
|
using static ARMeilleure.Instructions.InstEmitHelper;
|
2020-07-13 12:48:14 +02:00
|
|
|
|
|
|
|
namespace ARMeilleure.Instructions
|
|
|
|
{
|
|
|
|
static partial class InstEmit32
|
|
|
|
{
|
|
|
|
public static void Crc32b(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
EmitCrc32Call(context, ByteSizeLog2, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Crc32h(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
EmitCrc32Call(context, HWordSizeLog2, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Crc32w(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
EmitCrc32Call(context, WordSizeLog2, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Crc32cb(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
EmitCrc32Call(context, ByteSizeLog2, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Crc32ch(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
EmitCrc32Call(context, HWordSizeLog2, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Crc32cw(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
EmitCrc32Call(context, WordSizeLog2, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void EmitCrc32Call(ArmEmitterContext context, int size, bool c)
|
|
|
|
{
|
|
|
|
IOpCode32AluReg op = (IOpCode32AluReg)context.CurrOp;
|
|
|
|
|
|
|
|
Operand n = GetIntA32(context, op.Rn);
|
|
|
|
Operand m = GetIntA32(context, op.Rm);
|
|
|
|
|
|
|
|
Operand d = EmitCrc32(context, n, m, size, c);
|
|
|
|
|
|
|
|
EmitAluStore(context, d);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|