Skip to content

Commit cb03fed

Browse files
committed
Add unratified Zvzip instructions
1 parent 281d71e commit cb03fed

File tree

5 files changed

+1033
-0
lines changed

5 files changed

+1033
-0
lines changed
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
// Copyright (c) 2023. RISC-V International. All rights reserved.
2+
// SPDX-License-Identifier: BSD-3-Clause
3+
// -----------
4+
// This assembly file tests the vpaire.vv instruction.
5+
6+
// Define special purpose registers before including test_macros_vector.h
7+
#define DATA_BASE x3
8+
#define SIG_BASE x4
9+
#define VLENB_CACHE x5
10+
#define HELPER_GPR x6
11+
12+
#include "test_macros_vector.h"
13+
14+
RVTEST_ISA("RV32IV_Zicsr_Zvzip,RV64IV_Zicsr_Zvzip")
15+
16+
.section .text.init
17+
.globl rvtest_entry_point
18+
rvtest_entry_point:
19+
RVMODEL_BOOT
20+
21+
RVTEST_CODE_BEGIN
22+
23+
#ifdef TEST_CASE_1
24+
25+
RVTEST_CASE(0,"//check ISA:=regex(.*I.*V.*Zicsr.*Zvzip);def TEST_CASE_1=True;",vpaire.vv)
26+
27+
RVTEST_V_ENABLE()
28+
RVTEST_VALBASEUPD(DATA_BASE, dataset_tc1)
29+
RVTEST_SIGBASE(SIG_BASE, signature_tc1)
30+
31+
// VPAIRE.VV has the following inputs and outputs:
32+
// - input VS1: Op1
33+
// - input VS2: Op2
34+
// - input VM: Mask encoding (<nothing> or v0.t)
35+
// - output VD: Result
36+
37+
#define VINST vpaire.vv
38+
39+
inst_1x8:
40+
// This test will define v0, which will later be used as mask register
41+
TEST_CASE_VVV(1, 8, VINST, v0, v0, 0*8, v1, 1*8)
42+
//sig[1*8]
43+
44+
inst_2x8:
45+
TEST_CASE_VVV(2, 8, VINST, v1, v2, 0*8, v3, 1*8)
46+
//sig[2*8]
47+
48+
inst_3x8:
49+
TEST_CASE_VVV(3, 8, VINST, v4, v3, 0*8, v5, 3*8)
50+
//sig[3*8]
51+
52+
inst_4x8:
53+
TEST_CASE_VVV(4, 8, VINST, v5, v6, 0*8, v7, 5*8)
54+
//sig[4*8]
55+
56+
inst_8x8:
57+
TEST_CASE_VVV_M(8, 8, VINST, v8, v7, 0*8, v9, 7*8)
58+
//sig[5*8]
59+
60+
inst_16x8:
61+
TEST_CASE_VVV(16, 8, VINST, v9, v10, 0*8, v11, 9*8)
62+
//sig[7*8]
63+
64+
inst_31x8:
65+
TEST_CASE_VVV(31, 8, VINST, v12, v11, 0*8, v13, 11*8)
66+
//sig[11*8]
67+
68+
69+
inst_1x16:
70+
TEST_CASE_VVV_M(1, 16, VINST, v13, v14, 0*8, v15, 2*8)
71+
//sig[12*8]
72+
73+
inst_2x16:
74+
TEST_CASE_VVV(2, 16, VINST, v16, v15, 0*8, v17, 4*8)
75+
//sig[13*8]
76+
77+
inst_4x16:
78+
TEST_CASE_VVV(4, 16, VINST, v17, v18, 0*8, v19, 6*8)
79+
//sig[14*8]
80+
81+
inst_8x16:
82+
TEST_CASE_VVV(8, 16, VINST, v20, v19, 0*8, v21, 8*8)
83+
//sig[16*8]
84+
85+
inst_16x16:
86+
TEST_CASE_VVV_M(16, 16, VINST, v21, v22, 0*8, v23, 10*8)
87+
//sig[20*8]
88+
89+
inst_31x16:
90+
TEST_CASE_VVV(31, 16, VINST, v24, v23, 0*8, v25, 12*8)
91+
//sig[28*8]
92+
93+
94+
inst_1x32:
95+
TEST_CASE_VVV(1, 32, VINST, v25, v26, 0*8, v27, 3*8)
96+
//sig[29*8]
97+
98+
inst_2x32:
99+
TEST_CASE_VVV(2, 32, VINST, v28, v27, 0*8, v29, 5*8)
100+
//sig[30*8]
101+
102+
inst_4x32:
103+
TEST_CASE_VVV(4, 32, VINST, v29, v30, 0*8, v31, 9*8)
104+
//sig[32*8]
105+
106+
inst_8x32:
107+
TEST_CASE_VVV_M(8, 32, VINST, v1, v31, 0*8, v7, 7*8)
108+
//sig[36*8]
109+
110+
inst_16x32:
111+
TEST_CASE_VVV(16, 32, VINST, v31, v31, 0*8, v1, 1*8)
112+
//sig[44*8]
113+
114+
115+
inst_1x64:
116+
TEST_CASE_VVV(1, 64, VINST, v1, v3, 0*8, v3, 0*8)
117+
//sig[45*8]
118+
119+
inst_2x64:
120+
TEST_CASE_VVV(2, 64, VINST, v2, v4, 0*8, v5, 5*8)
121+
//sig[47*8]
122+
123+
inst_4x64:
124+
TEST_CASE_VVV(4, 64, VINST, v3, v5, 0*8, v7, 7*8)
125+
//sig[51*8]
126+
127+
inst_8x64:
128+
TEST_CASE_VVV(8, 64, VINST, v4, v6, 0*8, v9, 9*8)
129+
//sig[59*8]
130+
131+
132+
inst_0:
133+
TEST_CASE_VVV_M(1, 64, VINST, v5, v7, 8*8, v11, 11*8)
134+
//sig[60*8]
135+
136+
inst_1:
137+
TEST_CASE_VVV(1, 64, VINST, v6, v8, 9*8, v13, 13*8)
138+
//sig[61*8]
139+
140+
inst_2:
141+
TEST_CASE_VVV(1, 64, VINST, v7, v9, 10*8, v15, 15*8)
142+
//sig[62*8]
143+
144+
inst_3:
145+
TEST_CASE_VVV(1, 64, VINST, v8, v10, 11*8, v17, 17*8)
146+
//sig[63*8]
147+
148+
inst_4:
149+
TEST_CASE_VVV_M(1, 64, VINST, v9, v20, 12*8, v19, 19*8)
150+
//sig[64*8]
151+
152+
inst_5:
153+
TEST_CASE_VVV(1, 64, VINST, v10, v30, 13*8, v31, 4*8)
154+
//sig[65*8]
155+
156+
#endif // TEST_CASE_1
157+
158+
RVTEST_CODE_END
159+
160+
RVMODEL_HALT
161+
162+
RVTEST_DATA_BEGIN
163+
.word 0xbabecafe // trapreg_sv
164+
.word 0xabecafeb // tramptbl_sv
165+
.word 0xbecafeba // mtvec_save
166+
.word 0xecafebab // mscratch_save
167+
168+
.p2align 6
169+
dataset_tc1:
170+
TEST_CASE_BLOCK_256B_0
171+
RVTEST_DATA_END
172+
173+
RVMODEL_DATA_BEGIN
174+
rvtest_sig_begin:
175+
sig_begin_canary:
176+
CANARY;
177+
178+
signature_tc1:
179+
//sig[0*8..127*8]
180+
.fill 128, 8, 0xdeadbeefdeadbeef
181+
182+
#ifdef rvtest_mtrap_routine
183+
184+
tsig_begin_canary:
185+
CANARY;
186+
tsig_begin_canary:
187+
CANARY;
188+
mtrap_sigptr:
189+
.fill 64*(XLEN/32),4,0xdeadbeef
190+
tsig_end_canary:
191+
CANARY;
192+
tsig_end_canary:
193+
CANARY;
194+
195+
#endif // rvtest_mtrap_routine
196+
197+
#ifdef rvtest_gpr_save
198+
199+
gpr_save:
200+
.fill 32*XLEN/32,4,0xdeadbeef
201+
202+
#endif // rvtest_gpr_save
203+
204+
sig_end_canary:
205+
CANARY;
206+
rvtest_sig_end:
207+
RVMODEL_DATA_END

0 commit comments

Comments
 (0)