diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /contrib/libs/base64/avx2/enc_avx2.c | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/base64/avx2/enc_avx2.c')
-rw-r--r-- | contrib/libs/base64/avx2/enc_avx2.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/contrib/libs/base64/avx2/enc_avx2.c b/contrib/libs/base64/avx2/enc_avx2.c index 25e36f40b4..5875684de4 100644 --- a/contrib/libs/base64/avx2/enc_avx2.c +++ b/contrib/libs/base64/avx2/enc_avx2.c @@ -1,22 +1,22 @@ -// If we have AVX2 support, pick off 24 bytes at a time for as long as we can. -// But because we read 32 bytes at a time, ensure we have enough room to do a -// full 32-byte read without segfaulting: -while (srclen >= 32) -{ - // Load string: - __m256i str = _mm256_loadu_si256((__m256i *)c); - - // Reshuffle: - str = enc_reshuffle(str); - - // Translate reshuffled bytes to the Base64 alphabet: - str = enc_translate(str); - - // Store: - _mm256_storeu_si256((__m256i *)o, str); - - c += 24; // 6 * 4 bytes of input - o += 32; // 8 * 4 bytes of output - outl += 32; - srclen -= 24; -} +// If we have AVX2 support, pick off 24 bytes at a time for as long as we can. +// But because we read 32 bytes at a time, ensure we have enough room to do a +// full 32-byte read without segfaulting: +while (srclen >= 32) +{ + // Load string: + __m256i str = _mm256_loadu_si256((__m256i *)c); + + // Reshuffle: + str = enc_reshuffle(str); + + // Translate reshuffled bytes to the Base64 alphabet: + str = enc_translate(str); + + // Store: + _mm256_storeu_si256((__m256i *)o, str); + + c += 24; // 6 * 4 bytes of input + o += 32; // 8 * 4 bytes of output + outl += 32; + srclen -= 24; +} |