ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

cm.push

T1 riscv alu insn
Create function call stack frame
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zcmp
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZcmp

Summary

Creates a stack frame: store ra and 0 to 12 saved registers to the stack frame, optionally allocate additional stack space. This instruction pushes (stores) the registers in reg_list to the memory below the stack pointer, and then creates the stack frame by decrementing the stack pointer by stack_adj.

Syntax / Encoding

cm.push {reg_list}, -stack_adj | 10111000xxxxxx10 (mask=0xff03 match=0xb802)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
16RV10111000xxxxxx100xff03 / 0xb802

Operands

NameDescription
rlistbits [7:4], not [0, 1, 2, 3]
spimmbits [3:2]

Reference Notes

Creates a stack frame: store `ra` and 0 to 12 saved registers to the stack frame, optionally allocate additional stack space.
This instruction pushes (stores) the registers in `reg_list` to the memory below the stack pointer,
and then creates the stack frame by decrementing the stack pointer by `stack_adj`.

Restrictions on stack_adj:

* it must be enough to store all of the listed registers
* it must be a multiple of 16 (bytes):
** for RV32 the allowed values are: 16, 32, 48, 64, 80, 96, 112
** for RV64 the allowed values are: 16, 32, 48, 64, 80, 96, 112, 128, 144, 160