* @brief Load a vector of gathered results from an array; */
| 815 | * @brief Load a vector of gathered results from an array; |
| 816 | */ |
| 817 | ASTCENC_SIMD_INLINE vfloat4 gatherf(const float* base, vint4 indices) |
| 818 | { |
| 819 | #if ASTCENC_SVE == 0 |
| 820 | alignas(16) int idx[4]; |
| 821 | storea(indices, idx); |
| 822 | alignas(16) float vals[4]; |
| 823 | vals[0] = base[idx[0]]; |
| 824 | vals[1] = base[idx[1]]; |
| 825 | vals[2] = base[idx[2]]; |
| 826 | vals[3] = base[idx[3]]; |
| 827 | return vfloat4(vals); |
| 828 | #else |
| 829 | svint32_t offsets = svset_neonq_s32(svundef_s32(), indices.m); |
| 830 | svfloat32_t data = svld1_gather_s32index_f32(svptrue_pat_b32(SV_VL4), base, offsets); |
| 831 | return vfloat4(svget_neonq_f32(data)); |
| 832 | #endif |
| 833 | } |
| 834 | |
| 835 | /** |
| 836 | * @brief Load a vector of gathered results from an array using byte indices from memory |