Implement Fletcher-16 using AVX2 instructions

This commit is contained in:
JosJuice
2023-09-24 09:36:14 +02:00
committed by Natalia Portillo
parent 712281aba5
commit 89382334ec
5 changed files with 352 additions and 11 deletions

View File

@@ -77,6 +77,13 @@ AARU_EXPORT int AARU_CALL fletcher16_update(fletcher16_ctx *ctx, const uint8_t *
#if defined(__x86_64__) || defined(__amd64) || defined(_M_AMD64) || defined(_M_X64) || defined(__I386__) || \
defined(__i386__) || defined(__THW_INTEL) || defined(_M_IX86)
if(have_avx2())
{
fletcher16_avx2(&ctx->sum1, &ctx->sum2, data, len);
return 0;
}
if(have_ssse3())
{
fletcher16_ssse3(&ctx->sum1, &ctx->sum2, data, len);