s_setpc_b64 GPU Native ISA AMD Scalar

Scalar Arithmetic

s_setpc_b64

Jump to an address specified in a scalar register. The argument is a byte address of the instruction to jump to.

Also written as s_set_pc_i64. AMD's machine-readable ISA specification lists this name for the same instruction.

Encoding

Binary Layout (AMD CDNA 4)
101111101
31:23
SDST
22:16
00011101
15:8
SSRC0
7:0
 

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

Format SOP1
Width 32 bits
Opcode 29
Identifier 0xBE801D00

Operands

  • SSRC0
    Read. N/A Data format: N/A (OPR_SREG, FMT_NUM_B64)

In AMD's order, as its machine-readable ISA specification lists them for the ENC_SOP1 encoding (AMD CDNA 4).

GFX Target Compatibility

TargetSupport
gfx1100✅ Supported

Related PTX Concepts

Function Return ↗
equivalent with restrictions
ret (PTX)

Related

More in Scalar Arithmetic

Reference

AMDGPU / GFX ISA

Semantics

PC = S0.i64

Example

s_setpc_b64 vcc

A real instruction accepted by the LLVM assembler, taken verbatim from LLVM's own AMDGPU MC test suite. Not from an AMD document, and not authored here.

Sources