Scalar Arithmetic Instructions
239 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_cvt_u32_f32 | s_cvt_u32_f32 | SOP1 | Convert from a single-precision float input to an unsigned 32-bit integer value and store the result into a scalar register. |
| s_ff0_i32_b32 | s_ff0_i32_b32 | SOP1 | Count the number of trailing "1" bits before the first "0" in a scalar input and store the result into a scalar register. Store -1 if there are no "0" bits in the input. |
| s_ff0_i32_b64 | s_ff0_i32_b64 | SOP1 | Count the number of trailing "1" bits before the first "0" in a scalar input and store the result into a scalar register. Store -1 if there are no "0" bits in the input. |
| 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. Store -1 if there are no "1" bits in the input. |
| 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. Store -1 if there are no "1" bits in the input. |
| 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. Store -1 if all input bits are the same. |
| 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. Store -1 if there are no "1" bits. |
| 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. Store -1 if there are no "1" bits. |
| 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. Store -1 if all input bits are the same. |
| 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_fmaak_f32 | s_fmaak_f32 | SOP2 | Multiply two single-precision float inputs and add a literal constant using fused multiply add, and store the result into a scalar register. |
| s_fmac_f16 | s_fmac_f16 | SOP2 | Multiply two half-precision float inputs and accumulate the result into the destination register using fused multiply add. |
| s_fmac_f32 | s_fmac_f32 | SOP2 | Multiply two single-precision float inputs and accumulate the result into the destination register using fused multiply add. |
| s_fmamk_f32 | s_fmamk_f32 | SOP2 | Multiply a single-precision float input with a literal constant and add a second single-precision float input using fused multiply add, and store the result into a scalar register. |
| s_get_barrier_state | s_get_barrier_state | SOP1 | Read out current barrier state. Increments KMCNT on issue and decrements KMCNT when operation completes. |
| s_get_pc_i64 | s_get_pc_i64 | SOP1 | Store the address of the next instruction to a scalar register. |
| s_get_shader_cycles_u64 | s_get_shader_cycles_u64 | SOP1 | Read the 64-bit SHADER_CYCLES register into a scalar register destination. |
| s_getpc_b64 | s_getpc_b64 | SOP1 | Store the address of the next instruction to a scalar register. The byte address of the instruction immediately following this instruction is saved to the destination. |
| s_getreg_b32 | s_getreg_b32 | SOPK | Read some or all of a hardware register into the LSBs of destination. |
| 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 summation results in an unsigned overflow. |
| 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 summation results in an unsigned overflow. |
| 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 summation results in an unsigned overflow. |
| 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 summation results in an unsigned overflow. |
| 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 and set SCC iff the result is nonzero. |
| 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 and set SCC iff the result is nonzero. |
| 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 and set SCC iff the result is nonzero. |
| 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 and set SCC iff the result is nonzero. |
| 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. The index in M0.u and the operand address in DST.u must be even for this operation. |
| 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. The index in M0.u and the operand address in SRC0.u must be even for this operation. |
| 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 nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 nonzero. |
| 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 nonzero. |
| 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 calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 nonzero. |
| 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 nonzero. |
| 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 calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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 calculated result is nonzero and store the original value of the EXEC mask into the scalar destination register. |
| 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. Clear the wave's PRIV bit and then jump to an address specified by the scalar input. The argument is a byte address of the instruction to jump to; this address is likely derived from the state passed into the trap handler. |
| s_rfe_i64 | s_rfe_i64 | SOP1 | Return from the exception handler. Clear the wave's PRIV bit and then jump to an address specified by the scalar input. |
| s_rfe_restore_b64 | s_rfe_restore_b64 | SOP2 | Return from exception handler and continue. This instruction may only be used within a trap handler. |
| 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_sendmsg_rtn_b32 | s_sendmsg_rtn_b32 | SOP1 | Send a message to upstream control hardware. |
| s_sendmsg_rtn_b64 | s_sendmsg_rtn_b64 | SOP1 | Send a message to upstream control hardware. |
| 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 | Jump to an address specified in a scalar register. |