pub fn shiftElementsLeft(vec: anytype, comptime amount: VectorCount(@TypeOf(vec)), shift_in: std.meta.Child(@TypeOf(vec))) @TypeOf(vec) vecamount: VectorCount(@TypeOf(vec))shift_in: std.meta.Child(@TypeOf(vec))271
272
273
274
275pub fn shiftElementsLeft(vec: anytype, comptime amount: VectorCount(@TypeOf(vec)), shift_in: std.meta.Child(@TypeOf(vec))) @TypeOf(vec) {
const V = @TypeOf(vec);
return mergeShift(vec, @as(V, @splat(shift_in)), amount);
}
Elements are shifted leftwards (towards lower indices). New elements are added to the right, and the leftmost elements are cut off so that no elements with indices below 0 remain.