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 inputs using a lookup table.

Implements a 3-input lookup table (LUT) operation. The result is determined by bits in the lookup table value for each input combination.

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

Parameters:

  • lut (SIMD[int32, 1]): 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:

Result of applying the lookup table operation to the inputs.