v_bcnt_u32_b32 GPU Native ISA AMD Vector
Lane Operations
Per-lane accumulating population count.
Encoding
The ENC_VOP3 layout from AMD's machine-readable ISA specification (AMD CDNA 5). Opcode 798 in OP rebuilds 0x00000000D71E0000, an identifier AMD lists for this encoding. Not the same in every generation: AMD CDNA 4 (opcode 651, field layout), AMD CDNA 3 (opcode 651, field layout), AMD CDNA 2 (opcode 651, field layout), AMD CDNA 1 (opcode 651, field layout), AMD RDNA 3.5 (field layout), AMD RDNA 3 (field layout), AMD RDNA 2 (opcode 868, field layout), AMD RDNA 1 (opcode 868, field layout). The same in AMD RDNA 4.
Operands
-
VDST
Destination VGPR -
S0
Value to count bits in -
S1
Accumulator operand
GFX Target Compatibility
| Target | Support |
|---|---|
| gfx942 | ✅ Supported |
| gfx1100 | ✅ Supported |
Related PTX Concepts
Related
More in Lane Operations
Reference
Description
Semantics
Example
v_bcnt_u32_b32 v1, v0, 0 // v1 = popcount(v0) + 0Original illustrative example, written for this site (not reproduced from a specific AMD document).
Sources
- AMD Machine-Readable GPU ISA Specification ↗ - Advanced Micro Devices, Inc.