SIMD module

set

procedure · 1 overloadSource

Returns a vector of N lanes with every lane equal to factor. The lane type is the type of factor, so cast literals (cast(s32) 7); a bare 7 makes s64 lanes. N must be a compile-time constant.

ExampleOpen in playground ↗
v := set(4, cast(s32) 7);
assert(v.data[0] == 7 && v.data[3] == 7);
set :: ($N: s64, factor: $T) -> SIMD_Array(N, T)

Returns a vector of N lanes with every lane equal to factor. The lane type is the type of factor, so cast literals (cast(s32) 7); a bare 7 makes s64 lanes. N must be a compile-time constant.

Parameters

$N: s64
factor: $T

Returns

ExampleOpen in playground ↗
v := set(4, cast(s32) 7);
assert(v.data[0] == 7 && v.data[3] == 7);

See also