Which source-register bits does C.SH store?
It writes the least-significant 16 bits of rs2' to memory; higher source-register bits do not contribute to the stored value.
16-bit encoding of sh, store lower 16 bits
C.SH uses the Zcb CSH format. It stores the low 16 bits of rs2' at rs1' plus zero-extended uimm. Both rs1' and rs2' map to x8-x15; uimm[1] comes from encoding bit 5 and uimm[0] is zero, so the offset is only 0 or 2.
Shows only official 16-bit fields, operands, conditions, and architectural state; it does not model a pipeline, cache, or timing.
A naturally aligned access cannot raise an address-misaligned exception; any address can still raise an access-fault according to the EEI's access rules.
C.SH maps compact rs1'/rs2' to x8-x15, reconstructs uimm of 0 or 2, and commits only rs2''s low 16 bits to the effective address.
Understand this scenario with real code like «c.sh x9, 2(x10) # store halfword».
It writes the least-significant 16 bits of rs2' to memory; higher source-register bits do not contribute to the stored value.
uimm[1] comes from encoding bit 5 and uimm[0] is fixed to zero, so the zero-extended offset can only be 0 or 2 bytes.