mirror of
https://github.com/aaru-dps/AaruBenchmark.git
synced 2025-12-16 19:24:36 +00:00
Add ARM special instructions implementation for CRC32.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.Intrinsics.Arm;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
@@ -411,15 +412,31 @@ namespace Aaru6.Checksums
|
||||
|
||||
static void Step(ref uint previousCrc, uint[][] table, byte[] data, uint len, bool useIso)
|
||||
{
|
||||
if(useIso &&
|
||||
Pclmulqdq.IsSupported &&
|
||||
Sse41.IsSupported &&
|
||||
Ssse3.IsSupported &&
|
||||
Sse2.IsSupported)
|
||||
if(useIso)
|
||||
{
|
||||
previousCrc = ~Clmul.Step(data, len, ~previousCrc);
|
||||
if(Pclmulqdq.IsSupported &&
|
||||
Sse41.IsSupported &&
|
||||
Ssse3.IsSupported &&
|
||||
Sse2.IsSupported)
|
||||
{
|
||||
previousCrc = ~Clmul.Step(data, len, ~previousCrc);
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
if(Crc32.Arm64.IsSupported)
|
||||
{
|
||||
previousCrc = ArmSimd.Step64(data, len, previousCrc);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(Crc32.IsSupported)
|
||||
{
|
||||
previousCrc = ArmSimd.Step32(data, len, previousCrc);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Unroll according to Intel slicing by uint8_t
|
||||
|
||||
Reference in New Issue
Block a user