| 101 | } |
| 102 | |
| 103 | void avx2_decode(const int64_t* digits, uint8_t fac_idx, uint8_t exp_idx, double* out_p) { |
| 104 | uint64_t factor = alp::U_FACT_ARR[fac_idx]; |
| 105 | double frac10 = alp::Constants<double>::FRAC_ARR[exp_idx]; |
| 106 | __m256i factor_sse = _mm256_set1_epi64x(factor); |
| 107 | __m256d frac10_sse = _mm256_set1_pd(frac10); |
| 108 | |
| 109 | auto digits_p = reinterpret_cast<const __m256i*>(digits); |
| 110 | |
| 111 | for (size_t i {0}; i < 256; ++i) { |
| 112 | __m256i digit = _mm256_loadu_si256(digits_p + i); |
| 113 | __m256i tmp_int = digit * factor_sse; |
| 114 | __m256d tmp_dbl = int64_to_double_fast_precise(tmp_int); |
| 115 | __m256d tmp_dbl_mlt = tmp_dbl * frac10_sse; |
| 116 | _mm256_storeu_pd(out_p + (i * 4), tmp_dbl_mlt); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | #endif |
| 121 |
nothing calls this directly
no test coverage detected