Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/x86/adler32: fix wrong array length in adler32_sse2_chunk() #347

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/x86/adler32_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
static forceinline ATTRIBUTES void
adler32_sse2_chunk(const __m128i *p, const __m128i *const end, u32 *s1, u32 *s2)
{
static const u16 _aligned_attribute(16) mults[4][16] = {
static const u16 _aligned_attribute(16) mults[4][8] = {
{ 32, 31, 30, 29, 28, 27, 26, 25 },
{ 24, 23, 22, 21, 20, 19, 18, 17 },
{ 16, 15, 14, 13, 12, 11, 10, 9 },
Expand Down Expand Up @@ -299,10 +299,10 @@ adler32_avx2_vnni_chunk(const __m256i *p, const __m256i *const end,
__m256i /* __v8su */ v_s2_d = zeroes;

do {
__m256i bytes_a = *p++;
__m256i bytes_b = *p++;
__m256i bytes_c = *p++;
__m256i bytes_d = *p++;
const __m256i bytes_a = *p++;
const __m256i bytes_b = *p++;
const __m256i bytes_c = *p++;
const __m256i bytes_d = *p++;

v_s2_a = _mm256_dpbusd_avx_epi32(v_s2_a, bytes_a, mults_a);
v_s2_b = _mm256_dpbusd_avx_epi32(v_s2_b, bytes_b, mults_b);
Expand Down
Loading