Skip to content

Commit db1fdd1

Browse files
Merge pull request #388 from ved-rivos/zcmop
Add ratified Zcmop extension
2 parents 82a0981 + 7cf18f2 commit db1fdd1

19 files changed

+2250
-0
lines changed

CHANGELOG.md

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,226 @@ Corrected missing RV64 strings in RVTEST_CASE macros for Zfh fcvt.h.l and simila
147147
- replacing LA(rd, 5b) with auipc rd, 0 in test_macros.h solves the compiler issue and produces similar code but without a bunch of preceeding nops
148148

149149

150+
## [3.8.9] -- 2024-01-12
151+
- Fixed Check ISA fields to include 32/64 in Zicond tests. Note that the riscv-ctg CGFs have not been updated.
152+
153+
## [3.8.8] -- 2024-01-04
154+
- Fixed macros to allow assembling tests with LLVM.
155+
156+
## [3.8.7] -- 2024-01-02
157+
- Update satp initialization macro
158+
159+
## [3.8.6] -- 2023-12-24
160+
- Fixed check ISA fields to include 32/64 in Zca and CMO tests. Note that the riscv-ctg CGFs have not been updated.
161+
- Fixed check ISA fields in rv32e_m/B/src/ror-01 and rori-01 that listed I instead of E. Again, CGF has not been updated.
162+
163+
## [3.8.5] -- 2023-12-23
164+
- Renamed rv32e_unratified to rv32e_m because the E extension has been ratified January 2023
165+
- Copied missing ebreak.S and ecall.S tests from rv32i_m/privilege to rv32e_m/privilege and update ISA for E
166+
167+
## [3.8.3] - 2023-11-30
168+
- Add Zicond ISA extension support
169+
170+
## [3.8.4] - 2023-11-30
171+
172+
- Added test suites for `zcb` from code size reduction extension.
173+
- Added test macro for instructions with single operand.
174+
175+
## [3.8.2.3] -- 2013-11-19
176+
-Fixed typo in regex in 3.8.2.2
177+
178+
## [3.8.2.2] -- 2013-11-17
179+
- Restored *RV32 Check ISA attributes to RV32IM test cases where they were dropped in 3.8.2. Missed these on 3.8.2.1.
180+
181+
## [3.8.2.1] -- 2013-11-15
182+
- Restored *RV64 Check ISA attributes to RV64IM test cases where they were dropped in 3.8.2. Similar to 3.7.5
183+
184+
## [3.8.2] - 2023-11-14
185+
- Added "most negative number divided by -1" case for RV64IM and RV32IM in remw, divw, div and rem tests
186+
187+
## [3.8.1] - 2023-11-01
188+
- Updated trap handler to avoid using mstatush when used for Priv Arch 1.11
189+
- Updated GOTO_Lower_Mode macro to adjust the save area when switching to Umode.
190+
191+
## [3.8.0] - 2023-10-26
192+
- Updated trap handler to handle delegated exceptions in S-mode for both bare and virtual modes.
193+
- Added Hypervisor mode support in Trap handler
194+
- Updated the save area within the trap handler file.
195+
- Improved CSR Rename macro for code clarity.
196+
197+
## [3.7.5] - 2023-10-11
198+
Add missing check ISA fields in recently modified div and amo tests
199+
200+
## [3.7.4] - 2023-10-04
201+
- Fix typos in CONTRIBUTION.md
202+
203+
## [3.7.3] - 2023-09-29
204+
- Added test RV32i_m/div-01.S and RV64i_m/div-01.S tests.
205+
- Added tests for resolving missing coverage issue of harcoded registers[issue #306](https://github.com/riscv-non-isa/riscv-arch-test/issues/306)
206+
## [3.7.2] - 2023-08-16
207+
- Added RV32E_Privilege,RV32E_B and RV32E_Fencei tests with cgf files
208+
209+
## [3.7.2] - 2023-09-27
210+
- Modified macros to allow assembling tests with LLVM 18+
211+
212+
## [3.7.1] - 2023-08-03
213+
- Add ACTs for Atomic Extension excluding Lr/Sc Instructions.
214+
- Added Test macro for the execution of atomic instructions.
215+
216+
## [3.7.1] - 2023-07-30
217+
- Add support for unratified Svadu extension
218+
219+
## [3.8.20] - 2024-05-08
220+
- Updated the Zcmop extension
221+
222+
## [3.8.19] - 2024-05-08
223+
- Add support for unratified Svadu extension
224+
225+
## [3.8.18] - 2024-05-08
226+
- Add Zacas ISA extension support.
227+
228+
## [3.8.17] - 2024-05-03
229+
- Add Zfa support.
230+
-
231+
## [3.8.16] - 2024-04-26
232+
- Split rv32i_m/F/fnmadd_b15.S, fnmsub_b15.S, fmadd_b15.S, fmsub_b15.S into multiple smaller tests
233+
234+
## [3.8.15] - 2024-04-20
235+
Corrected missing 32 string in RVTEST_CASE macros for Zcb rv32i_m/C/clh-01.S
236+
237+
## [3.8.14] - 2024-04-16
238+
Add missing `Zfh` ISA in RVTEST_CASE for `Zfh` fdiv related tests
239+
240+
## [3.8.13] - 2024-04-13
241+
- Fixed missing `F` and `Zfh` ISA identifiers in `Zfh/flh-align-01` RVTEST_CASE macro.
242+
243+
244+
## [3.8.12] - 2024-03-26
245+
Corrected missing RV64 strings in RVTEST_CASE macros for Zfh fcvt.h.l and similar tests
246+
247+
## [3.8.11] - 2024-03-26
248+
- Added test suites for Zfh extensions.
249+
- Introduced half word and half width in Nan boxing functionality to accomdate Zfh extensions.
250+
- Added test suites for Zfinx extensions.
251+
252+
## [3.8.10] -- 2024-03-24
253+
- Updated TEST_JALR_OP in test_macros.h
254+
- The macro no longer works when rd = x0 in versions of GCC newer than 2023.12.20
255+
- riscof throws a message /home/jstine/cvw/addins/riscv-arch-test/riscv-test-suite/rv32i_m/I/src/jalr-01.S:72: Error: illegal operands `la x0,5b'
256+
- The TEST_JALR_OP macro invokes LA, which does not like x0 as an operand
257+
- replacing LA(rd, 5b) with auipc rd, 0 in test_macros.h solves the compiler issue and produces similar code but without a bunch of preceeding nops
258+
259+
260+
## [3.8.9] -- 2024-01-12
261+
- Fixed Check ISA fields to include 32/64 in Zicond tests. Note that the riscv-ctg CGFs have not been updated.
262+
263+
## [3.8.8] -- 2024-01-04
264+
- Fixed macros to allow assembling tests with LLVM.
265+
266+
## [3.8.7] -- 2024-01-02
267+
- Update satp initialization macro
268+
269+
## [3.8.6] -- 2023-12-24
270+
- Fixed check ISA fields to include 32/64 in Zca and CMO tests. Note that the riscv-ctg CGFs have not been updated.
271+
- Fixed check ISA fields in rv32e_m/B/src/ror-01 and rori-01 that listed I instead of E. Again, CGF has not been updated.
272+
273+
## [3.8.5] -- 2023-12-23
274+
- Renamed rv32e_unratified to rv32e_m because the E extension has been ratified January 2023
275+
- Copied missing ebreak.S and ecall.S tests from rv32i_m/privilege to rv32e_m/privilege and update ISA for E
276+
277+
## [3.8.3] - 2023-11-30
278+
- Add Zicond ISA extension support
279+
280+
## [3.8.4] - 2023-11-30
281+
282+
- Added test suites for `zcb` from code size reduction extension.
283+
- Added test macro for instructions with single operand.
284+
285+
## [3.8.2.3] -- 2013-11-19
286+
-Fixed typo in regex in 3.8.2.2
287+
288+
## [3.8.2.2] -- 2013-11-17
289+
- Restored *RV32 Check ISA attributes to RV32IM test cases where they were dropped in 3.8.2. Missed these on 3.8.2.1.
290+
291+
## [3.8.2.1] -- 2013-11-15
292+
- Restored *RV64 Check ISA attributes to RV64IM test cases where they were dropped in 3.8.2. Similar to 3.7.5
293+
294+
## [3.8.2] - 2023-11-14
295+
- Added "most negative number divided by -1" case for RV64IM and RV32IM in remw, divw, div and rem tests
296+
297+
## [3.8.1] - 2023-11-01
298+
- Updated trap handler to avoid using mstatush when used for Priv Arch 1.11
299+
- Updated GOTO_Lower_Mode macro to adjust the save area when switching to Umode.
300+
301+
## [3.8.0] - 2023-10-26
302+
- Updated trap handler to handle delegated exceptions in S-mode for both bare and virtual modes.
303+
- Added Hypervisor mode support in Trap handler
304+
- Updated the save area within the trap handler file.
305+
- Improved CSR Rename macro for code clarity.
306+
307+
## [3.7.5] - 2023-10-11
308+
Add missing check ISA fields in recently modified div and amo tests
309+
310+
## [3.7.4] - 2023-10-04
311+
- Fix typos in CONTRIBUTION.md
312+
313+
## [3.7.3] - 2023-09-29
314+
- Added test RV32i_m/div-01.S and RV64i_m/div-01.S tests.
315+
- Added tests for resolving missing coverage issue of harcoded registers[issue #306](https://github.com/riscv-non-isa/riscv-arch-test/issues/306)
316+
## [3.7.2] - 2023-08-16
317+
- Added RV32E_Privilege,RV32E_B and RV32E_Fencei tests with cgf files
318+
319+
## [3.7.2] - 2023-09-27
320+
- Modified macros to allow assembling tests with LLVM 18+
321+
322+
## [3.7.1] - 2023-08-03
323+
- Add ACTs for Atomic Extension excluding Lr/Sc Instructions.
324+
- Added Test macro for the execution of atomic instructions.
325+
326+
## [3.7.1] - 2023-07-30
327+
- Add support for unratified Svadu extension
328+
329+
## [3.8.20] - 2024-05-08
330+
- Add Zimop extension.
331+
-
332+
## [3.8.19] - 2024-05-08
333+
- Add support for unratified Svadu extension
334+
335+
## [3.8.18] - 2024-05-08
336+
- Add Zacas ISA extension support.
337+
338+
## [3.8.17] - 2024-05-03
339+
- Add Zfa support.
340+
-
341+
## [3.8.16] - 2024-04-26
342+
- Split rv32i_m/F/fnmadd_b15.S, fnmsub_b15.S, fmadd_b15.S, fmsub_b15.S into multiple smaller tests
343+
344+
## [3.8.15] - 2024-04-20
345+
Corrected missing 32 string in RVTEST_CASE macros for Zcb rv32i_m/C/clh-01.S
346+
347+
## [3.8.14] - 2024-04-16
348+
Add missing `Zfh` ISA in RVTEST_CASE for `Zfh` fdiv related tests
349+
350+
## [3.8.13] - 2024-04-13
351+
- Fixed missing `F` and `Zfh` ISA identifiers in `Zfh/flh-align-01` RVTEST_CASE macro.
352+
353+
354+
## [3.8.12] - 2024-03-26
355+
Corrected missing RV64 strings in RVTEST_CASE macros for Zfh fcvt.h.l and similar tests
356+
357+
## [3.8.11] - 2024-03-26
358+
- Added test suites for Zfh extensions.
359+
- Introduced half word and half width in Nan boxing functionality to accomdate Zfh extensions.
360+
- Added test suites for Zfinx extensions.
361+
362+
## [3.8.10] -- 2024-03-24
363+
- Updated TEST_JALR_OP in test_macros.h
364+
- The macro no longer works when rd = x0 in versions of GCC newer than 2023.12.20
365+
- riscof throws a message /home/jstine/cvw/addins/riscv-arch-test/riscv-test-suite/rv32i_m/I/src/jalr-01.S:72: Error: illegal operands `la x0,5b'
366+
- The TEST_JALR_OP macro invokes LA, which does not like x0 as an operand
367+
- replacing LA(rd, 5b) with auipc rd, 0 in test_macros.h solves the compiler issue and produces similar code but without a bunch of preceeding nops
368+
369+
150370
## [3.8.9] -- 2024-01-12
151371
- Fixed Check ISA fields to include 32/64 in Zicond tests. Note that the riscv-ctg CGFs have not been updated.
152372

coverage/zcmop.cgf

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
c.mop.1:
2+
config:
3+
- check ISA:=regex(.*C.*Zcmop.*)
4+
mnemonics:
5+
c.mop.1:
6+
val_comb:
7+
abstract_comb:
8+
<<: *cbimm_val_walking
9+
10+
c.mop.3:
11+
config:
12+
- check ISA:=regex(.*C.*Zcmop.*)
13+
opcode:
14+
c.mop.3:
15+
val_comb:
16+
abstract_comb:
17+
<<: *cbimm_val_walking
18+
19+
c.mop.5:
20+
config:
21+
- check ISA:=regex(.*C.*Zcmop.*)
22+
opcode:
23+
c.mop.5:
24+
val_comb:
25+
abstract_comb:
26+
<<: *cbimm_val_walking
27+
28+
c.mop.7:
29+
config:
30+
- check ISA:=regex(.*C.*Zcmop.*)
31+
opcode:
32+
c.mop.7:
33+
val_comb:
34+
abstract_comb:
35+
<<: *cbimm_val_walking
36+
37+
c.mop.9:
38+
config:
39+
- check ISA:=regex(.*C.*Zcmop.*)
40+
opcode:
41+
c.mop.9:
42+
val_comb:
43+
abstract_comb:
44+
<<: *cbimm_val_walking
45+
46+
c.mop.11:
47+
config:
48+
- check ISA:=regex(.*C.*Zcmop.*)
49+
opcode:
50+
c.mop.11:
51+
val_comb:
52+
abstract_comb:
53+
<<: *cbimm_val_walking
54+
55+
c.mop.13:
56+
config:
57+
- check ISA:=regex(.*C.*Zcmop.*)
58+
opcode:
59+
c.mop.13:
60+
val_comb:
61+
abstract_comb:
62+
<<: *cbimm_val_walking
63+
64+
c.mop.15:
65+
config:
66+
- check ISA:=regex(.*C.*Zcmop.*)
67+
opcode:
68+
c.mop.15:
69+
val_comb:
70+
abstract_comb:
71+
<<: *cbimm_val_walking

riscv-test-suite/env/test_macros.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,13 @@ ADDI(swreg, swreg, RVMODEL_CBZ_BLOCKSIZE)
952952
inst imm_val ;\
953953
)
954954

955+
//Tests c.mop.* instructions
956+
#define TEST_CMOP_OP(inst, destreg, imm_val, swreg, testreg, offset) \
957+
TEST_CASE(testreg, destreg, imm_val, swreg, offset, \
958+
mv destreg, swreg; \
959+
inst; \
960+
)
961+
955962
//Tests for instructions with register-immediate operand and update the saturation flag
956963
#define TEST_PKIMM_OP( inst, destreg, reg, correctval, val, imm, flagreg, swreg, offset, testreg) \
957964
TEST_CASE(testreg, destreg, correctval, swreg, offset, \

0 commit comments

Comments
 (0)