2022-08-05 19:03:50 +02:00
|
|
|
using ARMeilleure.Decoders;
|
|
|
|
using ARMeilleure.IntermediateRepresentation;
|
|
|
|
using ARMeilleure.Translation;
|
|
|
|
|
|
|
|
using static ARMeilleure.Instructions.InstEmitHelper;
|
|
|
|
|
|
|
|
namespace ARMeilleure.Instructions
|
|
|
|
{
|
|
|
|
static partial class InstEmit32
|
|
|
|
{
|
2023-06-26 07:25:06 +02:00
|
|
|
#region "Sha256"
|
2022-08-05 19:03:50 +02:00
|
|
|
public static void Sha256h_V(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
OpCode32SimdReg op = (OpCode32SimdReg)context.CurrOp;
|
|
|
|
|
|
|
|
Operand d = GetVecA32(op.Qd);
|
|
|
|
Operand n = GetVecA32(op.Qn);
|
|
|
|
Operand m = GetVecA32(op.Qm);
|
|
|
|
|
2022-08-25 12:12:13 +02:00
|
|
|
Operand res = InstEmitSimdHashHelper.EmitSha256h(context, d, n, m, part2: false);
|
2022-08-05 19:03:50 +02:00
|
|
|
|
|
|
|
context.Copy(GetVecA32(op.Qd), res);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Sha256h2_V(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
OpCode32SimdReg op = (OpCode32SimdReg)context.CurrOp;
|
|
|
|
|
|
|
|
Operand d = GetVecA32(op.Qd);
|
|
|
|
Operand n = GetVecA32(op.Qn);
|
|
|
|
Operand m = GetVecA32(op.Qm);
|
|
|
|
|
2022-08-25 12:12:13 +02:00
|
|
|
Operand res = InstEmitSimdHashHelper.EmitSha256h(context, n, d, m, part2: true);
|
2022-08-05 19:03:50 +02:00
|
|
|
|
|
|
|
context.Copy(GetVecA32(op.Qd), res);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Sha256su0_V(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
OpCode32Simd op = (OpCode32Simd)context.CurrOp;
|
|
|
|
|
|
|
|
Operand d = GetVecA32(op.Qd);
|
|
|
|
Operand m = GetVecA32(op.Qm);
|
|
|
|
|
2022-08-25 12:12:13 +02:00
|
|
|
Operand res = InstEmitSimdHashHelper.EmitSha256su0(context, d, m);
|
2022-08-05 19:03:50 +02:00
|
|
|
|
|
|
|
context.Copy(GetVecA32(op.Qd), res);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Sha256su1_V(ArmEmitterContext context)
|
|
|
|
{
|
|
|
|
OpCode32SimdReg op = (OpCode32SimdReg)context.CurrOp;
|
|
|
|
|
|
|
|
Operand d = GetVecA32(op.Qd);
|
|
|
|
Operand n = GetVecA32(op.Qn);
|
|
|
|
Operand m = GetVecA32(op.Qm);
|
|
|
|
|
2022-08-25 12:12:13 +02:00
|
|
|
Operand res = InstEmitSimdHashHelper.EmitSha256su1(context, d, n, m);
|
2022-08-05 19:03:50 +02:00
|
|
|
|
|
|
|
context.Copy(GetVecA32(op.Qd), res);
|
|
|
|
}
|
2023-06-26 07:25:06 +02:00
|
|
|
#endregion
|
2022-08-05 19:03:50 +02:00
|
|
|
}
|
|
|
|
}
|