From ab3fb17a74a3a41f6b503f80477f93507fbebe6f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 20 Feb 2023 23:43:30 +0800 Subject: [PATCH] fix(query): set correct shift bits. --- source/util/src/tcompression.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/util/src/tcompression.c b/source/util/src/tcompression.c index 695a83abb1..6d3260e0cd 100644 --- a/source/util/src/tcompression.c +++ b/source/util/src/tcompression.c @@ -315,8 +315,8 @@ int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, cha __m256i inc = _mm256_set1_epi64x(bit << 2); for (int32_t i = 0; i < batch; ++i) { - __m256i after = _mm256_srlv_epi64(base, shiftBits); - __m256i zigzagVal = _mm256_and_si256(after, maskVal); + base = _mm256_srlv_epi64(base, shiftBits); + __m256i zigzagVal = _mm256_and_si256(base, maskVal); // ZIGZAG_DECODE(T, v) (((v) >> 1) ^ -((T)((v)&1))) __m256i signmask = _mm256_and_si256(_mm256_set1_epi64x(1), zigzagVal); @@ -327,8 +327,8 @@ int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, cha // calculate the cumulative sum (prefix sum) for each number // decode[0] = prev_value + final[0] // decode[1] = decode[0] + final[1] -----> prev_value + final[0] + final[1] - // decode[2] = decode[1] + final[1] -----> prev_value + final[0] + final[1] + final[2] - // decode[3] = decode[2] + final[1] -----> prev_value + final[0] + final[1] + final[2] + final[3] + // decode[2] = decode[1] + final[2] -----> prev_value + final[0] + final[1] + final[2] + // decode[3] = decode[2] + final[3] -----> prev_value + final[0] + final[1] + final[2] + final[3] // 1, 2, 3, 4 //+ 0, 1, 2, 3 -- GitLab