Commit Graph

1 Commits

Author SHA1 Message Date
Robin Voetter
50a29f7c21 Add @select
@select(
    comptime T: type,
    pred: std.meta.Vector(len, bool),
    a: std.meta.Vector(len, T),
    b: std.meta.Vector(len, T)
) std.meta.Vector(len, T)

Constructs a vector from a & b, based on the values in the predicate vector. For indices where the predicate value is true, the corresponding
element from the a vector is selected, and otherwise from b.
2021-07-26 20:05:48 -04:00