Zcmop instructions
Compressed May-Be-Operations
The "Zcmop" extension, which defines eight 16-bit MOP
instructions named C.MOP.n, where n is an odd integer between 1 and
15, inclusive. C.MOP.n is encoded in the reserved encoding space
corresponding to C.LUI xn, 0, as shown in c mop.
Unlike the MOPs defined in the Zimop extension, the C.MOP.n instructions
are defined to not write any register.
Their encoding allows future extensions to define them to read register
x[__n__].
The Zcmop extension depends upon the Zca extension.
Note: Very few suitable 16-bit encoding spaces exist. This space was chosen
because it already has unusual behavior with respect to the rd/rs1
field--it encodes c.addi16sp when the field contains x2--and is
therefore of lower value for most purposes.
C.MOP.n instruction encoding.
| Mnemonic | Encoding | Redefinable to read register |
|---|---|---|
| C.MOP.1 | 0110000010000001 | x1 |
| C.MOP.3 | 0110000110000001 | x3 |
| C.MOP.5 | 0110001010000001 | x5 |
| C.MOP.7 | 0110001110000001 | x7 |
| C.MOP.9 | 0110010010000001 | x9 |
| C.MOP.11 | 0110010110000001 | x11 |
| C.MOP.13 | 0110011010000001 | x13 |
| C.MOP.15 | 0110011110000001 | x15 |
Note: The recommended assembly syntax for C.MOP.n is simply the nullary
C.MOP.n. The possibly accessed register is implicitly x__n__.
Note: The expectation is that each Zcmop instruction is equivalent to some
Zimop instruction, but the choice of expansion (if any) is left to the
extension that redefines the MOP.
Note, a Zcmop instruction that does not write a value can expand into a write
to x0.
Extension description from riscv-unified-db, reformatted.
Specification chapter: The RISC-V Instruction Set Manual, src/unpriv/zcmop.adoc.
Instructions (9)
| Mnemonic | Name (riscv-unified-db) | XLEN |
|---|---|---|
c.mop.1 | Compressed May-Be-Operation 1 (pseudo-op) | RV32 and RV64 |
c.mop.3 | Compressed May-Be-Operation 3 (pseudo-op) | RV32 and RV64 |
c.mop.5 | Compressed May-Be-Operation 5 (pseudo-op) | RV32 and RV64 |
c.mop.7 | Compressed May-Be-Operation 7 (pseudo-op) | RV32 and RV64 |
c.mop.9 | Compressed May-Be-Operation 9 (pseudo-op) | RV32 and RV64 |
c.mop.11 | Compressed May-Be-Operation 11 (pseudo-op) | RV32 and RV64 |
c.mop.13 | Compressed May-Be-Operation 13 (pseudo-op) | RV32 and RV64 |
c.mop.15 | Compressed May-Be-Operation 15 (pseudo-op) | RV32 and RV64 |
c.mop.N | RV32 and RV64 |