<<<
[#insns-cm_popretz,reftext="Pop registers, deallocate stack frame, return zero."]
=== cm.popretz

Synopsis::
Destroy stack frame: load ra and 0 to 12 saved registers from the stack frame, deallocate the stack frame, move zero into a0, return to ra.

Mnemonic::
cm.popretz _{reg_list}, stack_adj_

Encoding (RV32, RV64)::
[wavedrom, , svg]
....
{reg:[
    { bits:  2, name: 0x2,             attr: ['C2'] },
    { bits:  2, name: 'spimm\[5:4\]',  attr: [] },
    { bits:  4, name: 'rlist',         attr: [] },
    { bits:  5, name: 0x1c,            attr: [] },
    { bits:  3, name: 0x5,             attr: ['FUNCT3'] },
],config:{bits:16}}
....

[NOTE]

  _rlist_ values 0 to 3 are reserved for a future EABI variant called _cm.popretz.e_


Assembly Syntax::

[source,sail]
--
cm.popretz {reg_list},  stack_adj
cm.popretz {xreg_list}, stack_adj
--

include::pushpop_vars.adoc[]

<<<

Description::
This instruction pops (loads) the registers in _reg_list_ from stack memory,
 adjusts the stack pointer by _stack_adj_, moves zero into a0 and then returns to _ra_.

include::pushpop_extra_info.adoc[]
include::cm_pop_popret_loads_pseudo_code.adoc[]
include::cm_popretz_pseudo_code.adoc[]

include::Zcmp_footer.adoc[]

