From: krk Date: Thu, 29 Jan 2026 19:52:49 +0000 (+0000) Subject: Add software prefetch to AVX2 base64 encoder hot loop X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f49db10161948e09107a51ae77c9f1f3aa5dd93e;p=thirdparty%2Fopenssl.git Add software prefetch to AVX2 base64 encoder hot loop Reviewed-by: Dmitry Belyavskiy Reviewed-by: Paul Dale MergeDate: Fri Feb 13 14:31:43 2026 (Merged from https://github.com/openssl/openssl/pull/29858) --- diff --git a/crypto/evp/enc_b64_avx2.c b/crypto/evp/enc_b64_avx2.c index b3f46e66aec..141e7fcc87e 100644 --- a/crypto/evp/enc_b64_avx2.c +++ b/crypto/evp/enc_b64_avx2.c @@ -493,6 +493,7 @@ int encode_base64_avx2(EVP_ENCODE_CTX *ctx, unsigned char *dst, /* Process 96 bytes at a time */ for (; i + 100 <= srclen; i += 96) { + _mm_prefetch((const char *)(input + i + 192), _MM_HINT_T0); /* We shave off 4 bytes from the beginning and the end */ const __m128i lo0 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 0)); const __m128i hi0 = _mm_loadu_si128((const __m128i *)(input + i + 4 * 3 * 1));