| 123 | // Like xsimd::zip_lo, but zip groups of kNumBytes at once. |
| 124 | template <typename Arch, int kNumBytes> |
| 125 | auto 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. |
| 148 | template <typename Arch, int kNumBytes> |
nothing calls this directly
no outgoing calls
no test coverage detected