|
24 | 24 | #include <map> |
25 | 25 |
|
26 | 26 | #include "arrow/util/alp/AlpConstants.h" |
27 | | -#include "arrow/util/alp/alp_simd_internal.h" |
28 | 27 | #include "arrow/util/bit_stream_utils_internal.h" |
29 | 28 | #include "arrow/util/bpacking_internal.h" |
30 | 29 | #include "arrow/util/logging.h" |
@@ -681,38 +680,17 @@ void AlpCompression<T>::DecodeVector(TargetType* output_vector, |
681 | 680 | const ExactType* data = input_vector.data(); |
682 | 681 | const ExactType frame_of_ref = vector_info.frame_of_reference; |
683 | 682 |
|
684 | | - // Use SIMD-optimized path when T == TargetType (no type conversion needed) |
685 | | - if constexpr (std::is_same_v<T, TargetType>) { |
686 | | - // Get the two factors separately to preserve exact floating-point precision |
687 | | - // Original decode: value * GetFactor(factor) * Constants::GetFactor(exponent) |
688 | | - const int64_t int_factor = |
689 | | - AlpConstants::GetFactor(vector_info.exponent_and_factor.factor); |
690 | | - const T float_factor = |
691 | | - Constants::GetFactor(vector_info.exponent_and_factor.exponent); |
692 | | - |
693 | | - if constexpr (std::is_same_v<T, double>) { |
694 | | - internal::DecodeVectorSimdDouble(data, output_vector, num_elements, frame_of_ref, |
695 | | - int_factor, float_factor); |
696 | | - } else { |
697 | | - static_assert(std::is_same_v<T, float>); |
698 | | - internal::DecodeVectorSimdFloat(data, output_vector, num_elements, frame_of_ref, |
699 | | - int_factor, float_factor); |
700 | | - } |
701 | | - } else { |
702 | | - // Fall back to scalar loop for type conversions (e.g., float -> double) |
703 | | - // to preserve exact floating-point behavior |
704 | 683 | #pragma GCC unroll AlpConstants::kLoopUnrolls |
705 | 684 | #pragma GCC ivdep |
706 | | - for (size_t i = 0; i < num_elements; ++i) { |
707 | | - // 1. Apply frame of reference (unFOR) - unsigned arithmetic |
708 | | - const ExactType unfored_value = data[i] + frame_of_ref; |
709 | | - // 2. Reinterpret as signed integer for decode |
710 | | - SignedExactType signed_value; |
711 | | - std::memcpy(&signed_value, &unfored_value, sizeof(SignedExactType)); |
712 | | - // 3. Decode using original function to preserve exact floating-point behavior |
713 | | - output_vector[i] = |
714 | | - AlpInlines<T>::DecodeValue(signed_value, vector_info.exponent_and_factor); |
715 | | - } |
| 685 | + for (size_t i = 0; i < num_elements; ++i) { |
| 686 | + // 1. Apply frame of reference (unFOR) - unsigned arithmetic |
| 687 | + const ExactType unfored_value = data[i] + frame_of_ref; |
| 688 | + // 2. Reinterpret as signed integer for decode |
| 689 | + SignedExactType signed_value; |
| 690 | + std::memcpy(&signed_value, &unfored_value, sizeof(SignedExactType)); |
| 691 | + // 3. Decode using original function to preserve exact floating-point behavior |
| 692 | + output_vector[i] = |
| 693 | + AlpInlines<T>::DecodeValue(signed_value, vector_info.exponent_and_factor); |
716 | 694 | } |
717 | 695 | } |
718 | 696 |
|
|
0 commit comments