Does SH1ADD access memory?
No. It only reads and writes integer registers; any memory access must be performed by a separate load or store instruction.
Shift left by 1 and add
SH1ADD uses opcode 0110011 (0x33), funct3 010, funct7 0010000. The rs1 and rs2 fields select the two source registers, and rd selects the destination register.
Shifts rs1 left by 1 then adds rs2: rd = rs2 + (rs1 << 1). For halfword (2-byte) array address generation. Part of Zba.
SH1ADD is a B/Zba instruction for rs2 plus rs1 shifted left by 1. This page is checked against the official B extension semantics, with emphasis on XLEN, W suffixes, .uw suffixes, and bitwise or rotate boundaries.
Understand this scenario with real code like «sh1add x10, x11, x12 ; x10 = x12 + (x11 << 1)».
Understand this scenario with real code like «sh1add x10, x11, x12 ; x10 = x12 + (x11 << 1)».
No. It only reads and writes integer registers; any memory access must be performed by a separate load or store instruction.
Except that W-suffixed forms produce a 32-bit result then sign-extend and .uw forms first extract a 32-bit unsigned operand, the result is written to rd at XLEN width.