From b2571d47c6d316bf8e59dbda64daeeaafc395d01 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 25 May 2021 23:06:50 -0400 Subject: Add CRC32Wx4 and CRC32CWx4 for 4 blocks at a time --- crc_simd.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'crc_simd.cpp') diff --git a/crc_simd.cpp b/crc_simd.cpp index 1bbc8757..0355e9be 100644 --- a/crc_simd.cpp +++ b/crc_simd.cpp @@ -121,12 +121,7 @@ void CRC32_Update_ARMV8(const byte *s, size_t n, word32& c) c = CRC32B(c, *s); for(; n >= 16; s+=16, n-=16) - { - c = CRC32W(c, *(const word32 *)(void*)(s+ 0)); - c = CRC32W(c, *(const word32 *)(void*)(s+ 4)); - c = CRC32W(c, *(const word32 *)(void*)(s+ 8)); - c = CRC32W(c, *(const word32 *)(void*)(s+12)); - } + c = CRC32Wx4(c, (const word32 *)(void*)s); for(; n >= 4; s+=4, n-=4) c = CRC32W(c, *(const word32 *)(void*)s); @@ -141,12 +136,7 @@ void CRC32C_Update_ARMV8(const byte *s, size_t n, word32& c) c = CRC32CB(c, *s); for(; n >= 16; s+=16, n-=16) - { - c = CRC32CW(c, *(const word32 *)(void*)(s+ 0)); - c = CRC32CW(c, *(const word32 *)(void*)(s+ 4)); - c = CRC32CW(c, *(const word32 *)(void*)(s+ 8)); - c = CRC32CW(c, *(const word32 *)(void*)(s+12)); - } + c = CRC32CWx4(c, (const word32 *)(void*)s); for(; n >= 4; s+=4, n-=4) c = CRC32CW(c, *(const word32 *)(void*)s); -- cgit v1.2.1