gather

std.simd.gather

fun gather_f32x4

pub fun gather_f32x4(base: *f32, idx: u32x4) f32x4;

base 的四个 u32 索引处收集四个 f32 通道

base:源数组指针 idxbase 中每个通道的元素索引 ret{base[idx[0]], base[idx[1]], base[idx[2]], base[idx[3]]}

fun gather_i32x4

pub fun gather_i32x4(base: *i32, idx: u32x4) i32x4;

base 的四个 u32 索引处收集四个 i32 通道

base:源数组指针 idxbase 中每个通道的元素索引 ret{base[idx[0]], base[idx[1]], base[idx[2]], base[idx[3]]}

fun gather_u32x4

pub fun gather_u32x4(base: *u32, idx: u32x4) u32x4;

base 的四个 u32 索引处收集四个 u32 通道

base:源数组指针 idxbase 中每个通道的元素索引 ret{base[idx[0]], base[idx[1]], base[idx[2]], base[idx[3]]}

fun scatter_f32x4

pub fun scatter_f32x4(base: *f32, idx: u32x4, v: f32x4);

将四个 f32 通道分散写入到 base 的四个 u32 索引处

base:目标数组指针 idxbase 中每个通道的元素索引 v:要存储的通道,v[i] 写入到 base[idx[i]]

fun scatter_i32x4

pub fun scatter_i32x4(base: *i32, idx: u32x4, v: i32x4);

将四个 i32 通道分散写入到 base 的四个 u32 索引处

base:目标数组指针 idxbase 中每个通道的元素索引 v:要存储的通道,v[i] 写入到 base[idx[i]]