]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add software prefetch to AVX2 base64 encoder hot loop
authorkrk <keremkat@gmail.com>
Thu, 29 Jan 2026 19:52:49 +0000 (19:52 +0000)
committerTomas Mraz <tomas@openssl.org>
Fri, 13 Feb 2026 14:30:58 +0000 (15:30 +0100)
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Fri Feb 13 14:31:43 2026
(Merged from https://github.com/openssl/openssl/pull/29858)

crypto/evp/enc_b64_avx2.c

index b3f46e66aec4037bd3e0a69e3180bbf79e38fbed..141e7fcc87e5f761b27b8082089e7ad596bb345b 100644 (file)
@@ -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));