InstEmitSimdHash32.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using ARMeilleure.Decoders;
  2. using ARMeilleure.IntermediateRepresentation;
  3. using ARMeilleure.Translation;
  4. using static ARMeilleure.Instructions.InstEmitHelper;
  5. namespace ARMeilleure.Instructions
  6. {
  7. static partial class InstEmit32
  8. {
  9. #region "Sha256"
  10. public static void Sha256h_V(ArmEmitterContext context)
  11. {
  12. OpCode32SimdReg op = (OpCode32SimdReg)context.CurrOp;
  13. Operand d = GetVecA32(op.Qd);
  14. Operand n = GetVecA32(op.Qn);
  15. Operand m = GetVecA32(op.Qm);
  16. Operand res = context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.HashLower)), d, n, m);
  17. context.Copy(GetVecA32(op.Qd), res);
  18. }
  19. public static void Sha256h2_V(ArmEmitterContext context)
  20. {
  21. OpCode32SimdReg op = (OpCode32SimdReg)context.CurrOp;
  22. Operand d = GetVecA32(op.Qd);
  23. Operand n = GetVecA32(op.Qn);
  24. Operand m = GetVecA32(op.Qm);
  25. Operand res = context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.HashUpper)), d, n, m);
  26. context.Copy(GetVecA32(op.Qd), res);
  27. }
  28. public static void Sha256su0_V(ArmEmitterContext context)
  29. {
  30. OpCode32Simd op = (OpCode32Simd)context.CurrOp;
  31. Operand d = GetVecA32(op.Qd);
  32. Operand m = GetVecA32(op.Qm);
  33. Operand res = context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Sha256SchedulePart1)), d, m);
  34. context.Copy(GetVecA32(op.Qd), res);
  35. }
  36. public static void Sha256su1_V(ArmEmitterContext context)
  37. {
  38. OpCode32SimdReg op = (OpCode32SimdReg)context.CurrOp;
  39. Operand d = GetVecA32(op.Qd);
  40. Operand n = GetVecA32(op.Qn);
  41. Operand m = GetVecA32(op.Qm);
  42. Operand res = context.Call(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Sha256SchedulePart2)), d, n, m);
  43. context.Copy(GetVecA32(op.Qd), res);
  44. }
  45. #endregion
  46. }
  47. }