* @brief Load a vector of gathered results from an array; */
| 893 | * @brief Load a vector of gathered results from an array; |
| 894 | */ |
| 895 | ASTCENC_SIMD_INLINE vfloat4 gatherf(const float* base, vint4 indices) |
| 896 | { |
| 897 | #if ASTCENC_AVX >= 2 && ASTCENC_X86_GATHERS != 0 |
| 898 | return vfloat4(_mm_i32gather_ps(base, indices.m, 4)); |
| 899 | #else |
| 900 | alignas(16) int idx[4]; |
| 901 | storea(indices, idx); |
| 902 | return vfloat4(base[idx[0]], base[idx[1]], base[idx[2]], base[idx[3]]); |
| 903 | #endif |
| 904 | } |
| 905 | |
| 906 | /** |
| 907 | * @brief Load a vector of gathered results from an array using byte indices from memory |