Skip to main content

Mojo function

lop

lop[lut: Int32](a: Int32, b: Int32, c: Int32) -> Int32

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 (Int32): 32-bit lookup table value that defines the logical operation.

Args:

  • a (Int32): First input value.
  • b (Int32): Second input value.
  • c (Int32): Third input value.

Returns:

Int32: Result of applying the lookup table operation to the inputs.

Was this page helpful?