Get null bits for 8 32-bit row ids in `row_id32` at `col_pos` as a vector of 32-bit integers. Note that the result integer is 0 if the corresponding column is not null, or 1 otherwise.
| 43 | // integers. Note that the result integer is 0 if the corresponding column is not null, or |
| 44 | // 1 otherwise. |
| 45 | inline __m256i GetNullBitInt32(const RowTableImpl& rows, uint32_t col_pos, |
| 46 | __m256i row_id32) { |
| 47 | const uint8_t* null_masks = rows.null_masks(/*row_id=*/0); |
| 48 | __m256i null_mask_num_bits = |
| 49 | _mm256_set1_epi64x(rows.metadata().null_masks_bytes_per_row * 8); |
| 50 | __m256i row_lo = _mm256_cvtepi32_epi64(_mm256_castsi256_si128(row_id32)); |
| 51 | __m256i row_hi = _mm256_cvtepi32_epi64(_mm256_extracti128_si256(row_id32, 1)); |
| 52 | __m256i bit_id_lo = _mm256_mul_epi32(row_lo, null_mask_num_bits); |
| 53 | __m256i bit_id_hi = _mm256_mul_epi32(row_hi, null_mask_num_bits); |
| 54 | bit_id_lo = _mm256_add_epi64(bit_id_lo, _mm256_set1_epi64x(col_pos)); |
| 55 | bit_id_hi = _mm256_add_epi64(bit_id_hi, _mm256_set1_epi64x(col_pos)); |
| 56 | __m128i right_lo = _mm256_i64gather_epi32(reinterpret_cast<const int*>(null_masks), |
| 57 | _mm256_srli_epi64(bit_id_lo, 3), 1); |
| 58 | __m128i right_hi = _mm256_i64gather_epi32(reinterpret_cast<const int*>(null_masks), |
| 59 | _mm256_srli_epi64(bit_id_hi, 3), 1); |
| 60 | __m256i right = _mm256_set_m128i(right_hi, right_lo); |
| 61 | return _mm256_and_si256(_mm256_set1_epi32(1), _mm256_srli_epi32(right, col_pos & 7)); |
| 62 | } |
| 63 | |
| 64 | } // namespace arrow::compute |
no test coverage detected