sd

Store doubleword

This instruction is defined by:

Encoding

svg

Synopsis

For RV64, store 64 bits of data from register xs2 to an address formed by adding xs1 to a signed offset. <% if ext?(:Zilsd) %> For RV32, store doubleword from even/odd register pair. <% end %>

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

signed Bits<12> imm = sext({$encoding[31:25], $encoding[11:7]});
Bits<5> xs2 = $encoding[24:20];
Bits<5> xs1 = $encoding[19:15];

Execution

  • Pruned, XLEN == 64

  • Original

Bits<64> data;
XReg virtual_address = X[xs1] + $signed(imm);
data = X[xs2];
write_memory<64>(virtual_address, data, $encoding);
Bits<64> data;
XReg virtual_address = X[xs1] + $signed(imm);
if (xlen() == 32) {
  if (implemented?(ExtensionName::Zclsd)) {
    data = {X[xs2 + 1], X[xs2]};
  } else {
    raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
  }
} else {
  data = X[xs2];
}
write_memory<64>(virtual_address, data, $encoding);

Exceptions

This instruction may result in the following synchronous exceptions:

  • LoadAccessFault

  • StoreAmoAccessFault

  • StoreAmoPageFault