Function Return Control Flow
Transfer control back to the address saved by the most recent call.
Vendor-Neutral Definition
PC = saved_return_address.
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler
translations.
equivalent with restrictions
Both transfer control back to a previously saved return address.
| Property | NVIDIA PTX | AMDGPU |
|---|---|---|
| Instruction | ret | s_setpc_b64 |
| ISA Layer | Virtual | Native |
| Data Types | - | b64 |
| Version / Target Introduced | PTX ISA 1.0 | gfx1100 |
Important Differences
- PTX documents ret as having divergent-return semantics (suspending until all threads in the warp reconverge); AMDGPU's s_setpc_b64 is a plain unconditional jump to the address in the given register with no such wave-reconvergence handling of its own - that behavior, if needed, is the compiler's responsibility to construct separately.
Source Evidence
- Parallel Thread Execution ISA ↗ - NVIDIA Corporation
- User Guide for AMDGPU Backend ↗ - LLVM Project
Verification method: documentation