Skip to main content
Log in

Mojo function

lop

lop[lut: SIMD[int32, 1]](a: SIMD[int32, 1], b: SIMD[int32, 1], c: SIMD[int32, 1]) -> SIMD[int32, 1]

Performs an arbitrary logical operation on 3 input values using a lookup table.

This function implements a 3-input lookup table (LUT) operation, where the result is determined by the bits in the lookup table value for each possible input combination.

Note: - Only supported on NVIDIA GPUs. - Maps to the LOP3.B32 PTX instruction. - The lookup table value determines the output for each possible input combination.

Parameters:

  • lut (SIMD[int32, 1]): A 32-bit lookup table value that defines the logical operation.

Args:

  • a (SIMD[int32, 1]): First input value.
  • b (SIMD[int32, 1]): Second input value.
  • c (SIMD[int32, 1]): Third input value.

Returns:

The result of applying the lookup table operation to the inputs.