Scalar Arithmetic Instructions
225 AMDGPU instructions in this category - showing 100 per page, page 2 of 3 - click any row for encoding, pseudocode, and full documentation.
| Mnemonic | Syntax | Format | Summary |
|---|---|---|---|
| s_ff1_i32_b32 | s_ff1_i32_b32 | SOP1 | Count the number of trailing "0" bits before the first "1" in a scalar input and store the result into a scalar register. |
| s_ff1_i32_b64 | s_ff1_i32_b64 | SOP1 | Count the number of trailing "0" bits before the first "1" in a scalar input and store the result into a scalar register. |
| s_flbit_i32 | s_flbit_i32 | SOP1 | Count the number of leading bits that are the same as the sign bit of a scalar input and store the result into a scalar register. |
| s_flbit_i32_b32 | s_flbit_i32_b32 | SOP1 | Count the number of leading "0" bits before the first "1" in a scalar input and store the result into a scalar register. |
| s_flbit_i32_b64 | s_flbit_i32_b64 | SOP1 | Count the number of leading "0" bits before the first "1" in a scalar input and store the result into a scalar register. |
| s_flbit_i32_i64 | s_flbit_i32_i64 | SOP1 | Count the number of leading bits that are the same as the sign bit of a scalar input and store the result into a scalar register. |
| s_floor_f16 | s_floor_f16 | SOP1 | Round the half-precision float input down to previous integer and store the result in floating point format into a scalar register. |
| s_floor_f32 | s_floor_f32 | SOP1 | Round the single-precision float input down to previous integer and store the result in floating point format into a scalar register. |
| s_get_barrier_state | s_get_barrier_state | SOP1 | AMDGPU SOP1 scalar instruction. (Format and name extracted from LLVM's AMDGPU backend source - semantics not yet curated.) |
| s_get_pc_i64 | s_get_pc_i64 | SOP1 | AMDGPU SOP1 scalar instruction operating on i64 data. (Format and name extracted from LLVM's AMDGPU backend source - semantics not yet curated.) |
| s_get_shader_cycles_u64 | s_get_shader_cycles_u64 | SOP1 | AMDGPU SOP1 scalar instruction operating on u64 data. (Format and name extracted from LLVM's AMDGPU backend source - semantics not yet curated.) |
| s_getpc_b64 | s_getpc_b64 | SOP1 | Store the address of the next instruction to a scalar register. |
| s_lshl1_add_u32 | s_lshl1_add_u32 | SOP2 | Calculate the logical shift left of the first input by 1, then add the second input, store the result into a scalar register and set SCC iff the… |
| s_lshl2_add_u32 | s_lshl2_add_u32 | SOP2 | Calculate the logical shift left of the first input by 2, then add the second input, store the result into a scalar register and set SCC iff the… |
| s_lshl3_add_u32 | s_lshl3_add_u32 | SOP2 | Calculate the logical shift left of the first input by 3, then add the second input, store the result into a scalar register and set SCC iff the… |
| s_lshl4_add_u32 | s_lshl4_add_u32 | SOP2 | Calculate the logical shift left of the first input by 4, then add the second input, store the result into a scalar register and set SCC iff the… |
| s_lshl_b32 | s_lshl_b32 | SOP2 | Given a shift count in the second scalar input, calculate the logical shift left of the first scalar input, store the result into a scalar register… |
| s_lshl_b64 | s_lshl_b64 | SOP2 | Given a shift count in the second scalar input, calculate the logical shift left of the first scalar input, store the result into a scalar register… |
| s_lshr_b32 | s_lshr_b32 | SOP2 | Given a shift count in the second scalar input, calculate the logical shift right of the first scalar input, store the result into a scalar register… |
| s_lshr_b64 | s_lshr_b64 | SOP2 | Given a shift count in the second scalar input, calculate the logical shift right of the first scalar input, store the result into a scalar register… |
| s_max_f16 | s_max_f16 | SOP2 | Select the maximum of two half-precision float inputs and store the selected value into a scalar register. |
| s_max_f32 | s_max_f32 | SOP2 | Select the maximum of two single-precision float inputs and store the selected value into a scalar register. |
| s_max_i32 | s_max_i32 | SOP2 | Select the maximum of two signed 32-bit integer inputs, store the selected value into a scalar register and set SCC iff the first value is selected. |
| s_max_num_f16 | s_max_num_f16 | SOP2 | Select the IEEE maximumNumber() of two half-precision float inputs and store the selected value into a scalar register. |
| s_max_num_f32 | s_max_num_f32 | SOP2 | Select the IEEE maximumNumber() of two single-precision float inputs and store the selected value into a scalar register. |
| s_max_u32 | s_max_u32 | SOP2 | Select the maximum of two unsigned 32-bit integer inputs, store the selected value into a scalar register and set SCC iff the first value is selected. |
| s_maximum_f16 | s_maximum_f16 | SOP2 | Select the IEEE maximum() of two half-precision float inputs and store the selected value into a scalar register. |
| s_maximum_f32 | s_maximum_f32 | SOP2 | Select the IEEE maximum() of two single-precision float inputs and store the selected value into a scalar register. |
| s_min_f16 | s_min_f16 | SOP2 | Select the minimum of two half-precision float inputs and store the selected value into a scalar register. |
| s_min_f32 | s_min_f32 | SOP2 | Select the minimum of two single-precision float inputs and store the selected value into a scalar register. |
| s_min_i32 | s_min_i32 | SOP2 | Select the minimum of two signed 32-bit integer inputs, store the selected value into a scalar register and set SCC iff the first value is selected. |
| s_min_num_f16 | s_min_num_f16 | SOP2 | Select the IEEE minimumNumber() of two half-precision float inputs and store the selected value into a scalar register. |
| s_min_num_f32 | s_min_num_f32 | SOP2 | Select the IEEE minimumNumber() of two single-precision float inputs and store the selected value into a scalar register. |
| s_min_u32 | s_min_u32 | SOP2 | Select the minimum of two unsigned 32-bit integer inputs, store the selected value into a scalar register and set SCC iff the first value is selected. |
| s_minimum_f16 | s_minimum_f16 | SOP2 | Select the IEEE minimum() of two half-precision float inputs and store the selected value into a scalar register. |
| s_minimum_f32 | s_minimum_f32 | SOP2 | Select the IEEE minimum() of two single-precision float inputs and store the selected value into a scalar register. |
| s_mov_b32 | s_mov_b32 | SOP1 | Move scalar input into a scalar register. |
| s_mov_b64 | s_mov_b64 | SOP1 | Move scalar input into a scalar register. |
| s_movk_i32 | s_movk_i32 | SOPK | Sign extend a literal 16-bit constant and store the result into a scalar register. |
| s_movreld_b32 | s_movreld_b32 | SOP1 | Move data from a scalar input into a relatively-indexed scalar register. |
| s_movreld_b64 | s_movreld_b64 | SOP1 | Move data from a scalar input into a relatively-indexed scalar register. |
| s_movrels_b32 | s_movrels_b32 | SOP1 | Move data from a relatively-indexed scalar register into another scalar register. |
| s_movrels_b64 | s_movrels_b64 | SOP1 | Move data from a relatively-indexed scalar register into another scalar register. |
| s_movrelsd_2_b32 | s_movrelsd_2_b32 | SOP1 | Move data from a relatively-indexed scalar register into another relatively-indexed scalar register, using different offsets for each index. |
| s_mul_f16 | s_mul_f16 | SOP2 | Multiply two floating point inputs and store the result into a scalar register. |
| s_mul_f32 | s_mul_f32 | SOP2 | Multiply two floating point inputs and store the result into a scalar register. |
| s_mul_hi_i32 | s_mul_hi_i32 | SOP2 | Multiply two signed integers and store the high 32 bits of the result into a scalar register. |
| s_mul_hi_u32 | s_mul_hi_u32 | SOP2 | Multiply two unsigned integers and store the high 32 bits of the result into a scalar register. |
| s_mul_i32 | s_mul_i32 SDST, S0, S1 | SOP2 | Multiply two 32-bit signed scalar operands, wavefront-uniform, low 32 bits of the product. |
| s_mul_u64 | s_mul_u64 | SOP2 | Multiply two unsigned 64-bit integer inputs and store the result into a scalar register. |
| s_mulk_i32 | s_mulk_i32 | SOPK | Multiply a scalar input with the sign extension of a literal 16-bit constant and store the result into a scalar register. |
| s_nand_b32 | s_nand_b32 | SOP2 | Calculate bitwise NAND on two scalar inputs, store the result into a scalar register and set SCC if the result is nonzero. |
| s_nand_b64 | s_nand_b64 | SOP2 | Calculate bitwise NAND on two scalar inputs, store the result into a scalar register and set SCC if the result is nonzero. |
| s_nand_saveexec_b32 | s_nand_saveexec_b32 | SOP1 | Calculate bitwise NAND on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is… |
| s_nand_saveexec_b64 | s_nand_saveexec_b64 | SOP1 | Calculate bitwise NAND on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is… |
| s_nor_b32 | s_nor_b32 | SOP2 | Calculate bitwise NOR on two scalar inputs, store the result into a scalar register and set SCC if the result is nonzero. |
| s_nor_b64 | s_nor_b64 | SOP2 | Calculate bitwise NOR on two scalar inputs, store the result into a scalar register and set SCC if the result is nonzero. |
| s_nor_saveexec_b32 | s_nor_saveexec_b32 | SOP1 | Calculate bitwise NOR on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is… |
| s_nor_saveexec_b64 | s_nor_saveexec_b64 | SOP1 | Calculate bitwise NOR on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is… |
| s_not_b32 | s_not_b32 | SOP1 | Calculate bitwise negation on a scalar input, store the result into a scalar register and set SCC iff the result is nonzero. |
| s_not_b64 | s_not_b64 | SOP1 | Calculate bitwise negation on a scalar input, store the result into a scalar register and set SCC iff the result is nonzero. |
| s_or_b32 | s_or_b32 | SOP2 | Calculate bitwise OR on two scalar inputs, store the result into a scalar register and set SCC iff the result is nonzero. |
| s_or_b64 | s_or_b64 | SOP2 | Calculate bitwise OR on two scalar inputs, store the result into a scalar register and set SCC iff the result is nonzero. |
| s_or_not0_saveexec_b32 | s_or_not0_saveexec_b32 | SOP1 | Calculate bitwise OR on the EXEC mask and the negation of the scalar input, store the calculated result into the EXEC mask, set SCC iff the… |
| s_or_not0_saveexec_b64 | s_or_not0_saveexec_b64 | SOP1 | Calculate bitwise OR on the EXEC mask and the negation of the scalar input, store the calculated result into the EXEC mask, set SCC iff the… |
| s_or_not1_b32 | s_or_not1_b32 | SOP2 | Calculate bitwise OR with the first input and the negation of the second input, store the result into a scalar register and set SCC if the result is… |
| s_or_not1_b64 | s_or_not1_b64 | SOP2 | Calculate bitwise OR with the first input and the negation of the second input, store the result into a scalar register and set SCC if the result is… |
| s_or_not1_saveexec_b32 | s_or_not1_saveexec_b32 | SOP1 | Calculate bitwise OR on the scalar input and the negation of the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the… |
| s_or_not1_saveexec_b64 | s_or_not1_saveexec_b64 | SOP1 | Calculate bitwise OR on the scalar input and the negation of the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the… |
| s_or_saveexec_b32 | s_or_saveexec_b32 | SOP1 | Calculate bitwise OR on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is… |
| s_or_saveexec_b64 | s_or_saveexec_b64 | SOP1 | Calculate bitwise OR on the scalar input and the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the calculated result is… |
| s_orn1_saveexec_b32 | s_orn1_saveexec_b32 | SOP1 | Calculate bitwise OR on the EXEC mask and the negation of the scalar input, store the calculated result into the EXEC mask, set SCC iff the… |
| s_orn1_saveexec_b64 | s_orn1_saveexec_b64 | SOP1 | Calculate bitwise OR on the EXEC mask and the negation of the scalar input, store the calculated result into the EXEC mask, set SCC iff the… |
| s_orn2_b32 | s_orn2_b32 | SOP2 | Calculate bitwise OR with the first input and the negation of the second input, store the result into a scalar register and set SCC if the result is… |
| s_orn2_b64 | s_orn2_b64 | SOP2 | Calculate bitwise OR with the first input and the negation of the second input, store the result into a scalar register and set SCC if the result is… |
| s_orn2_saveexec_b32 | s_orn2_saveexec_b32 | SOP1 | Calculate bitwise OR on the scalar input and the negation of the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the… |
| s_orn2_saveexec_b64 | s_orn2_saveexec_b64 | SOP1 | Calculate bitwise OR on the scalar input and the negation of the EXEC mask, store the calculated result into the EXEC mask, set SCC iff the… |
| s_pack_hh_b32_b16 | s_pack_hh_b32_b16 | SOP2 | Pack two 16-bit scalar values into a scalar register. |
| s_pack_hl_b32_b16 | s_pack_hl_b32_b16 | SOP2 | Pack two 16-bit scalar values into a scalar register. |
| s_pack_lh_b32_b16 | s_pack_lh_b32_b16 | SOP2 | Pack two 16-bit scalar values into a scalar register. |
| s_pack_ll_b32_b16 | s_pack_ll_b32_b16 | SOP2 | Pack two 16-bit scalar values into a scalar register. |
| s_quadmask_b32 | s_quadmask_b32 | SOP1 | Reduce a pixel mask from the scalar input into a quad mask, store the result in a scalar register and set SCC iff the result is nonzero. |
| s_quadmask_b64 | s_quadmask_b64 | SOP1 | Reduce a pixel mask from the scalar input into a quad mask, store the result in a scalar register and set SCC iff the result is nonzero. |
| s_rfe_b64 | s_rfe_b64 | SOP1 | Return from the exception handler. |
| s_rfe_i64 | s_rfe_i64 | SOP1 | AMDGPU SOP1 scalar instruction operating on i64 data. (Format and name extracted from LLVM's AMDGPU backend source - semantics not yet curated.) |
| s_rndne_f16 | s_rndne_f16 | SOP1 | Round the half-precision float input to the nearest even integer and store the result in floating point format into a scalar register. |
| s_rndne_f32 | s_rndne_f32 | SOP1 | Round the single-precision float input to the nearest even integer and store the result in floating point format into a scalar register. |
| s_set_gpr_idx_idx | s_set_gpr_idx_idx | SOP1 | Set the index used in vector GPR indexing. S_SET_GPR_IDX_ON, S_SET_GPR_IDX_OFF, S_SET_GPR_IDX_MODE and S_SET_GPR_IDX_IDX are related instructions. |
| s_set_pc_i64 | s_set_pc_i64 | SOP1 | AMDGPU SOP1 scalar instruction operating on i64 data. (Format and name extracted from LLVM's AMDGPU backend source - semantics not yet curated.) |
| 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_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… |
| 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. |