A MOP (“may-be-operation”) is an instruction whose default behavior is deliberately boring — write zero to rd — so a later extension can redefine it into something real. The result: binaries carrying, say, control-flow-integrity checks run correctly on cores that never heard of CFI, the checks quietly evaporating. MOPs can’t be HINTs — HINTs may not touch architectural state, and writing rd is state.
The encodings
MOP.RR.n (n = 0…7) is the two-source variant: bit 30 carries n[2], bits 27:26 carry n[1:0], bit 25 = 1, and a real rs2 field replaces the constant — redefinable to read both sources.
Zcmop — the compressed eight
| Property | |
|---|---|
| Encoding | 0110 0nnn 1000 0001 — n[3:1] at bits 10:8, odd n from 1 to 15 (C.MOP.1, C.MOP.3, … C.MOP.15). |
| Default behavior | Writes NO register at all (unlike Zimop’s write-zero). |
| Redefinable to | Read the implicit register x[n] — C.MOP.1 may read x1, C.MOP.5 x5, etc. Nullary assembly syntax. |
| Expansion | Each is expected to correspond to some Zimop MOP (a non-writing one can expand to a write-to-x0). |
Hardware Designer Notes
Trivial hardware, strategic encoding: Zimop is how RISC-V buys forward compatibility for security features without an opt-in flag day. If you implement Zicfiss later, these 48 encodings are where it lives; until then they cost one decoder row.
Minimal Linux-boot hart MUST
- Decode all 40 Zimop encodings as write-zero-to-rd (single-cycle, no source reads) and the 8 Zcmop encodings as full no-ops
- Keep the decode patterns exact — neighboring SYSTEM/C.LUI encodings are NOT MOPs and must still trap or execute normally
MAY simplify / trap-and-emulate
- Claim MOPs later for standard redefinitions (Zicfiss) or leave them defaults forever — both conform
- Fuse the write-zero into your existing zero-idiom path (it is architecturally just li rd, 0)
Check yourself — may-be-operations
1.Why do MOPs write ZERO to rd instead of being pure no-ops, and why couldn't they just be HINTs?
2.Why do the Zimop MOPs live under the SYSTEM major opcode?
3.What's unusual about where C.MOP.n landed, and how do the compressed MOPs differ from MOP.R?