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

Function zip_lo_n

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

Source from the content-addressed store, hash-verified

123// Like xsimd::zip_lo, but zip groups of kNumBytes at once.
124template <typename Arch, int kNumBytes>
125auto zip_lo_n(const xsimd::batch<int8_t, Arch>& a,
126 const xsimd::batch<int8_t, Arch>& b) -> xsimd::batch<int8_t, Arch> {
127 using arrow::internal::SizedInt;
128 using simd_batch = xsimd::batch<int8_t, Arch>;
129 // For signed arithmetic
130 constexpr int kBatchSize = static_cast<int>(simd_batch::size);
131
132 if constexpr (kNumBytes == kBatchSize) {
133 return a;
134 } else if constexpr (kNumBytes <= 8) {
135 return xsimd::bitwise_cast<int8_t>(
136 xsimd::zip_lo(xsimd::bitwise_cast<SizedInt<kNumBytes>>(a),
137 xsimd::bitwise_cast<SizedInt<kNumBytes>>(b)));
138 } else if constexpr (kNumBytes == 16 && kBatchSize == 32) {
139 // No data type for 128 bits.
140 // This could be made generic by simply computing the shuffle permute constant
141 return xsimd::bitwise_cast<int8_t>(
142 xsimd::shuffle(xsimd::bitwise_cast<int64_t>(a), xsimd::bitwise_cast<int64_t>(b),
143 xsimd::batch_constant<uint64_t, Arch, 0, 1, 4, 5>{}));
144 }
145}
146
147// Like xsimd::zip_hi, but zip groups of kNumBytes at once.
148template <typename Arch, int kNumBytes>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected