Bit-Field Insert Bit Manipulation
Insert a contiguous bit field from one operand into another at a given position.
Vendor-Neutral Definition
d = (b & ~mask) | ((a << pos) & mask), where mask covers len bits starting at pos.
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler
translations.
equivalent with restrictions
Both insert a bit field from one operand into another at a given position; operand order and count differ.
| Property | NVIDIA PTX | AMDGPU |
|---|---|---|
| Instruction | bfi | v_bfi_b32 |
| ISA Layer | Virtual | Native |
| Data Types | - | b32 |
| Version / Target Introduced | PTX ISA 2.0 | gfx1100 |
Important Differences
- AMDGPU's v_bfi_b32 is documented as a generic (mask, a, b) select: D0 = (S0 & S1) | (~S0 & S2) - functionally a bit-select, not phrased in terms of a start position and length the way PTX's bfi is; the same result is achieved by constructing an appropriate mask operand.
Source Evidence
- Parallel Thread Execution ISA ↗ - NVIDIA Corporation
- User Guide for AMDGPU Backend ↗ - LLVM Project
Verification method: documentation