Implement Fletcher-32 using SSSE3 instructions.

This commit is contained in:
2023-09-24 20:52:36 +01:00
parent 05ea7f75fa
commit 544bc95fd0
2 changed files with 199 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ using System.Text;
using Aaru.Checksums.Fletcher32;
using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers;
using Ssse3 = System.Runtime.Intrinsics.X86.Ssse3;
namespace Aaru.Checksums;
@@ -134,6 +135,13 @@ public sealed class Fletcher32Context : IChecksum
return;
}
if(Ssse3.IsSupported)
{
Fletcher32.Ssse3.Step(ref previousSum1, ref previousSum2, data, len);
return;
}
if(AdvSimd.IsSupported)
{
Neon.Step(ref previousSum1, ref previousSum2, data, len);