← Home

Zcmp

Complex PUSH/POP and Double Move

Type: unprivileged

Requirements

Zca and not Zcd

Versions

VersionStateRatified
1.0.0ratified2023-04

Description

The Zcmp extension is a set of instructions which may be executed as a series of existing 32-bit RISC-V instructions.

This extension reuses some encodings from _c.fsdsp_. Therefore it is _incompatible_ with <<Zcd>>, which is included when C and D extensions are both present.

NOTE: Zcmp is primarily targeted at embedded class CPUs due to implementation complexity. Additionally, it is not compatible with architecture class profiles.

The Zcmp extension depends on the <<Zca>> extension.

The PUSH/POP assembly syntax uses several variables, the meaning of which are:

* _reg_list_ is a list containing 1 to 13 registers (ra and 0 to 12 s registers) ** valid values: {ra}, {ra, s0}, {ra, s0-s1}, {ra, s0-s2}, ..., {ra, s0-s8}, {ra, s0-s9}, {ra, s0-s11} ** note that {ra, s0-s10} is _not_ valid, giving 12 lists not 13 for better encoding * _stack_adj_ is the total size of the stack frame. ** valid values vary with register list length and the specific encoding, see the instruction pages for details.

RV32 RV64 Mnemonic Instruction

yes yes cm.push _{reg_list}, -stack_adj_ <<#insns-cm_push>>

yes yes cm.pop _{reg_list}, stack_adj_ <<#insns-cm_pop>>

yes yes cm.popret _{reg_list}, stack_adj_ <<#insns-cm_popret>>

yes yes cm.popretz _{reg_list}, stack_adj_ <<#insns-cm_popretz>>

yes yes cm.mva01s _rs1', rs2'_ <<#insns-cm_mva01s>>

yes yes cm.mvsa01 _r1s', r2s'_ <<#insns-cm_mvsa01>>

Instructions


Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.