zanmato1984 commented on code in PR #45336:
URL: https://github.com/apache/arrow/pull/45336#discussion_r1927384255
##########
cpp/src/arrow/compute/row/compare_internal_avx2.cc:
##########
@@ -64,14 +66,21 @@ uint32_t KeyCompare::NullUpdateColumnToRowImp_avx2(
irow_right =
_mm256_loadu_si256(reinterpret_cast<const
__m256i*>(left_to_right_map) + i);
}
- __m256i bitid =
- _mm256_mullo_epi32(irow_right, _mm256_set1_epi32(null_mask_num_bytes
* 8));
- bitid = _mm256_add_epi32(bitid, _mm256_set1_epi32(null_bit_id));
- __m256i right =
- _mm256_i32gather_epi32((const int*)null_masks,
_mm256_srli_epi32(bitid, 3), 1);
- right = _mm256_and_si256(
- _mm256_set1_epi32(1),
- _mm256_srlv_epi32(right, _mm256_and_si256(bitid,
_mm256_set1_epi32(7))));
+ __m256i irow_right_lo =
_mm256_cvtepi32_epi64(_mm256_castsi256_si128(irow_right));
+ __m256i irow_right_hi =
+ _mm256_cvtepi32_epi64(_mm256_extracti128_si256(irow_right, 1));
+ __m256i bit_id_lo =
+ _mm256_mul_epi32(irow_right_lo,
_mm256_set1_epi64x(null_mask_num_bytes * 8));
+ __m256i bit_id_hi =
+ _mm256_mul_epi32(irow_right_hi,
_mm256_set1_epi64x(null_mask_num_bytes * 8));
+ bit_id_lo = _mm256_add_epi64(bit_id_lo, pos_after_encoding);
+ bit_id_hi = _mm256_add_epi64(bit_id_hi, pos_after_encoding);
Review Comment:
I made the helper in the other comment though, which is independent of the
ones suggested in this comment. (I think these ones are more "basic" than that
one which is more row table specific.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]