Scalar Arithmetic Instructions
239 AMDGPU instructions in this category - showing 39 per page, page 3 of 3 - click any row for encoding, pseudocode, and full documentation.
| Mnemonic | Syntax | Format | Summary |
|---|---|---|---|
| s_setpc_b64 | s_setpc_b64 | SOP1 | Jump to an address specified in a scalar register. The argument is a byte address of the instruction to jump to. |
| s_setreg_b32 | s_setreg_b32 | SOPK | Write some or all of the LSBs of source argument into a hardware register. |
| s_setreg_imm32_b32 | s_setreg_imm32_b32 | SOPK | Write some or all of the LSBs of a 32-bit literal constant into a hardware register; this instruction requires a 32-bit literal constant. |
| s_sext_i32_i16 | s_sext_i32_i16 | SOP1 | Sign extend a signed 16 bit scalar input to 32 bits and store the result into a scalar register. |
| s_sext_i32_i8 | s_sext_i32_i8 | SOP1 | Sign extend a signed 8 bit scalar input to 32 bits and store the result into a scalar register. |
| s_sleep_var | s_sleep_var | SOP1 | Cause a wave to sleep for up to ~8000 clocks, or to sleep until an external event wakes the wave up. |
| s_soft_waitcnt_vscnt | s_soft_waitcnt_vscnt | SOPK | AMDGPU SOPK scalar instruction. (Format and name extracted from LLVM's AMDGPU backend source - semantics not yet curated.) |
| s_sub_co_ci_u32 | s_sub_co_ci_u32 | SOP2 | Subtract the second unsigned 32-bit integer input from the first input, subtract the carry-in bit, store the result into a scalar register and store the carry-out bit into SCC. |
| s_sub_co_i32 | s_sub_co_i32 | SOP2 | Subtract the second signed 32-bit integer input from the first input, store the result into a scalar register and store the carry-out bit into SCC. |
| s_sub_co_u32 | s_sub_co_u32 | SOP2 | Subtract the second unsigned 32-bit integer input from the first input, store the result into a scalar register and store the carry-out bit into SCC. |
| s_sub_f16 | s_sub_f16 | SOP2 | Subtract the second floating point input from the first input and store the result in a scalar register. |
| s_sub_f32 | s_sub_f32 | SOP2 | Subtract the second floating point input from the first input and store the result in a scalar register. |
| s_sub_i32 | s_sub_i32 | SOP2 | Subtract the second signed 32-bit integer input from the first input, store the result into a scalar register and store the carry-out bit into SCC. |
| s_sub_nc_u64 | s_sub_nc_u64 | SOP2 | Subtract the second unsigned 64-bit integer input from the first input and store the result into a scalar register. |
| s_sub_u32 | s_sub_u32 SDST, S0, S1 | SOP2 | Subtract two 32-bit unsigned scalar operands, wavefront-uniform. |
| s_sub_u64 | s_sub_u64 | SOP2 | AMDGPU SOP2 scalar instruction operating on u64 data. (Format and name extracted from LLVM's AMDGPU backend source - semantics not yet curated.) |
| s_subb_u32 | s_subb_u32 | SOP2 | Subtract the second unsigned 32-bit integer input from the first input, subtract the carry-in bit, store the result into a scalar register and store the carry-out bit into SCC. |
| s_subvector_loop_begin | s_subvector_loop_begin | SOPK | Begin execution of a subvector block of code. |
| s_subvector_loop_end | s_subvector_loop_end | SOPK | End execution of a subvector block of code. |
| s_swap_pc_i64 | s_swap_pc_i64 | SOP1 | Store the address of the next instruction to a scalar register and then jump to an address specified in the scalar input. |
| s_swappc_b64 | s_swappc_b64 | SOP1 | Store the address of the next instruction to a scalar register and then jump to an address specified in the scalar input. The argument is a byte address of the instruction to jump to. The byte address of the instruction immediately following this instruction is saved to the destination. |
| s_trunc_f16 | s_trunc_f16 | SOP1 | Compute the integer part of a half-precision float input using round toward zero semantics and store the result in floating point format into a scalar register. |
| s_trunc_f32 | s_trunc_f32 | SOP1 | Compute the integer part of a single-precision float input using round toward zero semantics and store the result in floating point format into a scalar register. |
| s_version | s_version | SOPK | Do nothing. This opcode is used to specify the microcode version for tools that interpret shader microcode. |
| s_waitcnt_expcnt | s_waitcnt_expcnt | SOPK | Wait for the EXPCNT counter to be at or below the specified level. The EXPCNT counter tracks the number of outstanding export events. |
| s_waitcnt_lgkmcnt | s_waitcnt_lgkmcnt | SOPK | Wait for the LGKMCNT counter to be at or below the specified level. The LGKMCNT counter tracks the number of outstanding local data share (L), global data share (G), scalar memory (K) and message (M) events. |
| s_waitcnt_vmcnt | s_waitcnt_vmcnt | SOPK | Wait for the VMCNT counter to be at or below the specified level. The VMCNT counter tracks the number of outstanding vector memory loads and atomics that do return data. When in 'all-in-order' mode, wait for all load and store vector memory events. |
| s_waitcnt_vscnt | s_waitcnt_vscnt | SOPK | Wait for the VSCNT counter to be at or below the specified level. The VSCNT counter tracks the number of outstanding vector memory stores and atomics that do not return data. This counter is not used in 'all-in-order' mode. |
| s_wakeup_barrier | s_wakeup_barrier | SOP1 | Wake up all waves associated with the named barrier indicated by S0. |
| s_wqm_b32 | s_wqm_b32 | SOP1 | Given an active pixel mask in a scalar input, calculate whole quad mode mask for that input, store the result into a scalar register and set SCC iff the result is nonzero. In whole quad mode, if any pixel in a quad is active then all pixels of the quad are marked active. |
| s_wqm_b64 | s_wqm_b64 | SOP1 | Given an active pixel mask in a scalar input, calculate whole quad mode mask for that input, store the result into a scalar register and set SCC iff the result is nonzero. In whole quad mode, if any pixel in a quad is active then all pixels of the quad are marked active. |
| s_xnor_b32 | s_xnor_b32 | SOP2 | Calculate bitwise XNOR on two scalar inputs, store the result into a scalar register and set SCC if the result is nonzero. |
| s_xnor_b64 | s_xnor_b64 | SOP2 | Calculate bitwise XNOR on two scalar inputs, store the result into a scalar register and set SCC if the result is nonzero. |
| s_xnor_saveexec_b32 | s_xnor_saveexec_b32 | SOP1 | Calculate bitwise XNOR on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| s_xnor_saveexec_b64 | s_xnor_saveexec_b64 | SOP1 | Calculate bitwise XNOR on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| s_xor_b32 | s_xor_b32 | SOP2 | Calculate bitwise XOR on two scalar inputs, store the result into a scalar register and set SCC iff the result is nonzero. |
| s_xor_b64 | s_xor_b64 | SOP2 | Calculate bitwise XOR on two scalar inputs, store the result into a scalar register and set SCC iff the result is nonzero. |
| s_xor_saveexec_b32 | s_xor_saveexec_b32 | SOP1 | Calculate bitwise XOR on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| s_xor_saveexec_b64 | s_xor_saveexec_b64 | SOP1 | Calculate bitwise XOR on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |