Skip to content

Commit 92cd472

Browse files
Implement Zcmop Compressed MOP Instructions (#530)
This commit adds support for the Zcmop extension by defining the 16-bit compressed C.MOP.n instructions. These instructions use a fixed encoding pattern with a variable field (mop_n_field) to select one of eight instructions (for odd n values from 1 to 15). By default, they do not write to any registers, which allows them to safely act as no-ops when the extension is not active. This change lays the foundation for future extensions that may redefine these instructions. Co-authored-by: Afonso Oliveira <Afonso.Oliveira@synopsys.com>
1 parent 39f8aa4 commit 92cd472

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

arch/inst/Zcmop/c.mop.n.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# yaml-language-server: $schema=../../../schemas/inst_schema.json
2+
3+
$schema: inst_schema.json#
4+
kind: instruction
5+
name: c.mop.n
6+
long_name: Compressed May-Be-Operation
7+
description: C.MOP.n is encoded in the reserved encoding space corresponding to C.LUI xn, 0. 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].
8+
definedBy: Zcmop
9+
assembly: ""
10+
encoding:
11+
match: 01100---10000001
12+
variables:
13+
- name: n
14+
location: 10-8
15+
access:
16+
s: always
17+
u: always
18+
vs: always
19+
vu: always
20+
data_independent_timing: false
21+
pseudoinstructions:
22+
- when: (n == 0)
23+
to: c.mop.1
24+
- when: (n == 1)
25+
to: c.mop.3
26+
- when: (n == 2)
27+
to: c.mop.5
28+
- when: (n == 3)
29+
to: c.mop.7
30+
- when: (n == 4)
31+
to: c.mop.9
32+
- when: (n == 5)
33+
to: c.mop.11
34+
- when: (n == 6)
35+
to: c.mop.13
36+
- when: (n == 7)
37+
to: c.mop.15
38+
operation(): "" #do nothing

0 commit comments

Comments
 (0)