MCPcopy Create free account
hub / github.com/apache/arrow / zip_hi_n

Function zip_hi_n

cpp/src/arrow/util/byte_stream_split_internal.h:149–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147// Like xsimd::zip_hi, but zip groups of kNumBytes at once.
148template <typename Arch, int kNumBytes>
149auto zip_hi_n(const xsimd::batch<int8_t, Arch>& a,
150 const xsimd::batch<int8_t, Arch>& b) -> xsimd::batch<int8_t, Arch> {
151 using simd_batch = xsimd::batch<int8_t, Arch>;
152 using arrow::internal::SizedInt;
153 // For signed arithmetic
154 constexpr int kBatchSize = static_cast<int>(simd_batch::size);
155
156 if constexpr (kNumBytes == kBatchSize) {
157 return b;
158 } else if constexpr (kNumBytes <= 8) {
159 return xsimd::bitwise_cast<int8_t>(
160 xsimd::zip_hi(xsimd::bitwise_cast<SizedInt<kNumBytes>>(a),
161 xsimd::bitwise_cast<SizedInt<kNumBytes>>(b)));
162 } else if constexpr (kNumBytes == 16 && kBatchSize == 32) {
163 // No data type for 128 bits
164 // This could be made generic by simply computing the shuffle permute constant
165 return xsimd::bitwise_cast<int8_t>(
166 xsimd::shuffle(xsimd::bitwise_cast<int64_t>(a), xsimd::bitwise_cast<int64_t>(b),
167 xsimd::batch_constant<uint64_t, Arch, 2, 3, 6, 7>{}));
168 }
169}
170
171template <typename Arch, int kNumStreams>
172void ByteStreamSplitEncodeSimd(const uint8_t* raw_values, int width,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected