Skip to content

Commit d0f01f8

Browse files
jmawetdhower-qc
andauthored
Update Zimop instructions (#455)
Signed-off-by: Derek Hower <134728312+dhower-qc@users.noreply.github.com> Co-authored-by: Derek Hower <134728312+dhower-qc@users.noreply.github.com>
1 parent 2d33a6d commit d0f01f8

File tree

2 files changed

+60
-61
lines changed

2 files changed

+60
-61
lines changed

arch/inst/Zimop/mop.r.n.yaml

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: mop.r.n
6-
long_name: No synopsis available.
6+
long_name: May-be-operation (1 source register).
77
description: |
8-
No description available.
8+
Unless redefined by another extension, this instructions simply writes 0 to X[xd].
9+
The encoding allows future extensions to define them to read X[xs1], as well as write X[xd].
910
definedBy: Zimop
10-
assembly: mop_r_t_30, mop_r_t_27_26, mop_r_t_21_20, xd, xs1
11+
assembly: xd, xs1
1112
encoding:
1213
match: 1-00--0111-------100-----1110011
1314
variables:
14-
- name: mop_r_t_30
15-
location: 30-30
16-
- name: mop_r_t_27_26
17-
location: 27-26
18-
- name: mop_r_t_21_20
19-
location: 21-20
20-
- name: rs1
15+
- name: n
16+
location: 30|27-26|21-20
17+
- name: xs1
2118
location: 19-15
22-
- name: rd
19+
- name: xd
2320
location: 11-7
2421
access:
2522
s: always
@@ -32,68 +29,69 @@ hints:
3229
- { $ref: inst/Zicfilp/sspopchk.x5.yaml# }
3330
- { $ref: inst/Zicfilp/ssrdp.yaml# }
3431
pseudoinstructions:
35-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x0) && (mop_r_t_27_26 == 0x0)
32+
- when: n == 0
3633
to: mop.r.0
37-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x1) && (mop_r_t_27_26 == 0x0)
34+
- when: n == 1
3835
to: mop.r.1
39-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x2) && (mop_r_t_27_26 == 0x0)
36+
- when: n == 2
4037
to: mop.r.2
41-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x3) && (mop_r_t_27_26 == 0x0)
38+
- when: n == 3
4239
to: mop.r.3
43-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x0) && (mop_r_t_27_26 == 0x1)
40+
- when: n == 4
4441
to: mop.r.4
45-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x1) && (mop_r_t_27_26 == 0x1)
42+
- when: n == 5
4643
to: mop.r.5
47-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x2) && (mop_r_t_27_26 == 0x1)
44+
- when: n == 6
4845
to: mop.r.6
49-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x3) && (mop_r_t_27_26 == 0x1)
46+
- when: n == 7
5047
to: mop.r.7
51-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x0) && (mop_r_t_27_26 == 0x2)
48+
- when: n == 8
5249
to: mop.r.8
53-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x1) && (mop_r_t_27_26 == 0x2)
50+
- when: n == 9
5451
to: mop.r.9
55-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x2) && (mop_r_t_27_26 == 0x2)
52+
- when: n == 10
5653
to: mop.r.10
57-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x3) && (mop_r_t_27_26 == 0x2)
54+
- when: n == 11
5855
to: mop.r.11
59-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x0) && (mop_r_t_27_26 == 0x3)
56+
- when: n == 12
6057
to: mop.r.12
61-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x1) && (mop_r_t_27_26 == 0x3)
58+
- when: n == 13
6259
to: mop.r.13
63-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x2) && (mop_r_t_27_26 == 0x3)
60+
- when: n == 14
6461
to: mop.r.14
65-
- when: (mop_r_t_30 == 0x0) && (mop_r_t_21_20 == 0x3) && (mop_r_t_27_26 == 0x3)
62+
- when: n == 15
6663
to: mop.r.15
67-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x0) && (mop_r_t_27_26 == 0x0)
64+
- when: n == 16
6865
to: mop.r.16
69-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x1) && (mop_r_t_27_26 == 0x0)
66+
- when: n == 17
7067
to: mop.r.17
71-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x2) && (mop_r_t_27_26 == 0x0)
68+
- when: n == 18
7269
to: mop.r.18
73-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x3) && (mop_r_t_27_26 == 0x0)
70+
- when: n == 19
7471
to: mop.r.19
75-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x0) && (mop_r_t_27_26 == 0x1)
72+
- when: n == 20
7673
to: mop.r.20
77-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x1) && (mop_r_t_27_26 == 0x1)
74+
- when: n == 21
7875
to: mop.r.21
79-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x2) && (mop_r_t_27_26 == 0x1)
76+
- when: n == 22
8077
to: mop.r.22
81-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x3) && (mop_r_t_27_26 == 0x1)
78+
- when: n == 23
8279
to: mop.r.23
83-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x0) && (mop_r_t_27_26 == 0x2)
80+
- when: n == 24
8481
to: mop.r.24
85-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x1) && (mop_r_t_27_26 == 0x2)
82+
- when: n == 25
8683
to: mop.r.25
87-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x2) && (mop_r_t_27_26 == 0x2)
84+
- when: n == 26
8885
to: mop.r.26
89-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x3) && (mop_r_t_27_26 == 0x2)
86+
- when: n == 27
9087
to: mop.r.27
91-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x0) && (mop_r_t_27_26 == 0x3)
88+
- when: n == 28
9289
to: mop.r.28
93-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x1) && (mop_r_t_27_26 == 0x3)
90+
- when: n == 29
9491
to: mop.r.29
95-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x2) && (mop_r_t_27_26 == 0x3)
92+
- when: n == 30
9693
to: mop.r.30
97-
- when: (mop_r_t_30 == 0x1) && (mop_r_t_21_20 == 0x3) && (mop_r_t_27_26 == 0x3)
94+
- when: n == 31
9895
to: mop.r.31
9996
operation(): |
97+
X[xd] = 0;

arch/inst/Zimop/mop.rr.n.yaml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
$schema: "inst_schema.json#"
44
kind: instruction
55
name: mop.rr.n
6-
long_name: No synopsis available.
6+
long_name: May-be-operation (2 source registers).
77
description: |
8-
No description available.
8+
The Zimop extension defines 8 MOP instructions named MOP.RR.n, where n is an integer between 0
9+
and 7, inclusive. Unless redefined by another extension, these instructions simply write 0 to X[xd].
10+
Their encoding allows future extensions to define them to read X[xs1] and X[xs2], as well as write X[xd].
911
definedBy: Zimop
10-
assembly: mop_rr_t_30, mop_rr_t_27_26, xd, xs1, xs2
12+
assembly: xd, xs1, xs2
1113
encoding:
1214
match: 1-00--1----------100-----1110011
1315
variables:
14-
- name: mop_rr_t_30
15-
location: 30-30
16-
- name: mop_rr_t_27_26
17-
location: 27-26
18-
- name: rs2
16+
- name: n
17+
location: 30|27-26
18+
- name: xs2
1919
location: 24-20
20-
- name: rs1
20+
- name: xs1
2121
location: 19-15
22-
- name: rd
22+
- name: xd
2323
location: 11-7
2424
access:
2525
s: always
@@ -31,20 +31,21 @@ hints:
3131
- { $ref: inst/Zicfilp/sspush.x1.yaml# }
3232
- { $ref: inst/Zicfilp/sspush.x5.yaml# }
3333
pseudoinstructions:
34-
- when: (mop_rr_t_30 == 0x0) && (mop_rr_t_27_26 == 0x0)
34+
- when: n == 0
3535
to: mop.rr.0
36-
- when: (mop_rr_t_30 == 0x0) && (mop_rr_t_27_26 == 0x1)
36+
- when: n == 1
3737
to: mop.rr.1
38-
- when: (mop_rr_t_30 == 0x0) && (mop_rr_t_27_26 == 0x2)
38+
- when: n == 2
3939
to: mop.rr.2
40-
- when: (mop_rr_t_30 == 0x0) && (mop_rr_t_27_26 == 0x3)
40+
- when: n == 3
4141
to: mop.rr.3
42-
- when: (mop_rr_t_30 == 0x1) && (mop_rr_t_27_26 == 0x0)
42+
- when: n == 4
4343
to: mop.rr.4
44-
- when: (mop_rr_t_30 == 0x1) && (mop_rr_t_27_26 == 0x1)
44+
- when: n == 5
4545
to: mop.rr.5
46-
- when: (mop_rr_t_30 == 0x1) && (mop_rr_t_27_26 == 0x2)
46+
- when: n == 6
4747
to: mop.rr.6
48-
- when: (mop_rr_t_30 == 0x1) && (mop_rr_t_27_26 == 0x3)
48+
- when: n == 7
4949
to: mop.rr.7
5050
operation(): |
51+
X[xd] = 0;

0 commit comments

Comments
 (0)