s_branch GPU Native ISA AMD Scalar

Branch & Control

s_branch offset

Unconditional relative branch.

Encoding

Binary Layout (AMD CDNA 5)
101111111
31:23
0100000
22:16
SIMM16
15:0
 

The ENC_SOPP layout from AMD's machine-readable ISA specification (AMD CDNA 5). Opcode 32 in OP rebuilds 0xBFA00000, an identifier AMD lists for this encoding. Not the same in every generation: AMD CDNA 4 (opcode 2), AMD CDNA 3 (opcode 2), AMD CDNA 2 (opcode 2), AMD CDNA 1 (opcode 2), AMD RDNA 2 (opcode 2), AMD RDNA 1 (opcode 2). The same in AMD RDNA 4, AMD RDNA 3.5, AMD RDNA 3.

Format SOPP
Width 32 bits
Opcode 32
Identifier 0xBFA00000
Execution Unit Scalar ALU

Operands

  • offset
    Signed word-granularity branch offset

GFX Target Compatibility

TargetSupport
gfx942✅ Supported
gfx1100✅ Supported

Related PTX Concepts

Branch ↗
equivalent with restrictions
bra (PTX)

Related

More in Branch & Control

Reference

AMDGPU / GFX ISA

Description

Jump to a constant offset relative to the current PC.

Semantics

PC = PC + 4 + signed_offset * 4.

Example

s_branch  label   // unconditional jump to label

Original illustrative example, written for this site (not reproduced from a specific AMD document).

Sources