sd

Store doubleword from even/odd register pair

This instruction is defined by:

  • Zilsd, version >= Zilsd@1.0.0

This instruction is included in the following profiles:

Encoding

svg

Assembly format

sd rs2, offset(rs1)

Synopsis

Stores a 64-bit value from registers rs2 and rs2+1. The effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

Bits<5> rs1 = $encoding[19:15];
Bits<5> rs2 = $encoding[24:20];
Bits<12> imm = {$encoding[31:25], $encoding[11:7]};

Execution

  • IDL

  • Sail

Bits<MXLEN> base = X[rs1];
Bits<MXLEN> offset = $signed(imm);
Bits<MXLEN> eff_addr = base + offset;
Bits<32> lower_word = X[rs2];
Bits<32> upper_word = X[rs2 + 1];
Bits<64> store_data = {upper_word, lower_word};
%%LINK%func;write_memory;write_memory%%<64>(eff_addr, store_data, $encoding);

Exceptions

This instruction may result in the following synchronous exceptions:

  • LoadAccessFault

  • StoreAmoAccessFault

  • StoreAmoAddressMisaligned

  • StoreAmoPageFault