DoxigAlpha

shuffleVector

Function parameters

Parameters

#
self:*WipFunction
name:[]const u8

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#

= 16

Values

#

Source

Implementation

#
pub fn shuffleVector(
    self: *WipFunction,
    lhs: Value,
    rhs: Value,
    mask: Value,
    name: []const u8,
) Allocator.Error!Value {
    assert(lhs.typeOfWip(self).isVector(self.builder));
    assert(lhs.typeOfWip(self) == rhs.typeOfWip(self));
    assert(mask.typeOfWip(self).scalarType(self.builder).isInteger(self.builder));
    _ = try self.ensureUnusedExtraCapacity(1, Instruction.ShuffleVector, 0);
    const instruction = try self.addInst(name, .{
        .tag = .shufflevector,
        .data = self.addExtraAssumeCapacity(Instruction.ShuffleVector{
            .lhs = lhs,
            .rhs = rhs,
            .mask = mask,
        }),
    });
    return instruction.toValue();
}