SH1ADD
Shift Left 1 and Add
SH1ADD rd, rs1, rs2
Shifts rs1 left by 1 and adds rs2. Used for calculating addresses of 16-bit elements.
Encoding
Binary Layout
0010000
31:25
rs2
24:20
rs1
19:15
010
14:12
rd
11:7
0110011
6:0
Operands
-
rd
Destination register (integer) -
rs1
Index -
rs2
Base
Example
SH1ADD x10, x11, x12
// Calculate address: x12 + (x11 * 2).
Related
More in Zba
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
SH1ADD shifts rs1 left by 1 bit, then adds the result to rs2, writing to rd. Used for stride-1 array indexing (byte element + base).
Operation
R[rd] = R[rs2] + (R[rs1] << 1);