Three-Input Bitwise Logic Bit Manipulation

Compute an arbitrary bitwise boolean function of three operands, selected by a truth-table constant.

Vendor-Neutral Definition

d = LUT[a, b, c], where LUT is an 8-bit truth table constant selecting the boolean function of the three 1-bit inputs at each bit position.
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler translations.
equivalent with restrictions Both compute an arbitrary 3-input bitwise boolean function selected by an 8-bit truth-table immediate.
Property NVIDIA PTX AMDGPU
Instruction lop3 v_bitop3_b32
ISA Layer Virtual Native
Data Types - b32
Version / Target Introduced PTX ISA 4.3 -

Important Differences

  • The truth-table encoding convention (which bit of the 8-bit immediate corresponds to which a/b/c input combination) is not guaranteed to be identical between PTX's lut and AMDGPU's bitop3 immediate - verify against both sources before porting a lut constant directly.

Source Evidence

Verification method: documentation