| 35 | /// |
| 36 | template <typename Predicate> |
| 37 | inline uint64_t LevelsToBitmap(const int16_t* levels, int64_t num_levels, |
| 38 | Predicate predicate) { |
| 39 | // Both clang and GCC can vectorize this automatically with SSE4/AVX2. |
| 40 | uint64_t mask = 0; |
| 41 | for (int x = 0; x < num_levels; x++) { |
| 42 | mask |= static_cast<uint64_t>(predicate(levels[x]) ? 1 : 0) << x; |
| 43 | } |
| 44 | return ::arrow::bit_util::ToLittleEndian(mask); |
| 45 | } |
| 46 | |
| 47 | inline MinMax FindMinMaxImpl(const int16_t* levels, int64_t num_levels) { |
| 48 | MinMax out{std::numeric_limits<int16_t>::max(), std::numeric_limits<int16_t>::min()}; |
no test coverage detected