Skip to content

Commit 865eb47

Browse files
committed
RISC-V: Add intrinsics testcases for SiFive Xsfvcp extensions.
1 parent c646364 commit 865eb47

28 files changed

+9543
-0
lines changed
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
/* { dg-do compile } */
2+
/* { dg-options "-march=rv64gcv_xsfvcp -mabi=lp64d -O3" } */
3+
/* { dg-final { check-function-bodies "**" "" } } */
4+
5+
#include "riscv_vector.h"
6+
7+
typedef _Float16 float16_t;
8+
typedef float float32_t;
9+
typedef double float64_t;
10+
11+
/*
12+
** test_sf_vc_fv_se_u16mf4:
13+
** ...
14+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
15+
** ...
16+
*/
17+
18+
void test_sf_vc_fv_se_u16mf4(const int bit_field26, const int bit_field11_7, vuint16mf4_t vs2, float16_t fs1, size_t vl)
19+
{
20+
__riscv_sf_vc_fv_se_u16mf4(bit_field26, bit_field11_7, vs2, fs1, vl);
21+
}
22+
23+
/*
24+
** test_sf_vc_fv_se_u16mf2:
25+
** ...
26+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
27+
** ...
28+
*/
29+
30+
void test_sf_vc_fv_se_u16mf2(const int bit_field26, const int bit_field11_7, vuint16mf2_t vs2, float16_t fs1, size_t vl)
31+
{
32+
__riscv_sf_vc_fv_se_u16mf2(bit_field26, bit_field11_7, vs2, fs1, vl);
33+
}
34+
35+
/*
36+
** test_sf_vc_fv_se_u16m1:
37+
** ...
38+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
39+
** ...
40+
*/
41+
42+
void test_sf_vc_fv_se_u16m1(const int bit_field26, const int bit_field11_7, vuint16m1_t vs2, float16_t fs1, size_t vl)
43+
{
44+
__riscv_sf_vc_fv_se_u16m1(bit_field26, bit_field11_7, vs2, fs1, vl);
45+
}
46+
47+
/*
48+
** test_sf_vc_fv_se_u16m2:
49+
** ...
50+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
51+
** ...
52+
*/
53+
54+
void test_sf_vc_fv_se_u16m2(const int bit_field26, const int bit_field11_7, vuint16m2_t vs2, float16_t fs1, size_t vl)
55+
{
56+
__riscv_sf_vc_fv_se_u16m2(bit_field26, bit_field11_7, vs2, fs1, vl);
57+
}
58+
59+
/*
60+
** test_sf_vc_fv_se_u16m4:
61+
** ...
62+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
63+
** ...
64+
*/
65+
66+
void test_sf_vc_fv_se_u16m4(const int bit_field26, const int bit_field11_7, vuint16m4_t vs2, float16_t fs1, size_t vl)
67+
{
68+
__riscv_sf_vc_fv_se_u16m4(bit_field26, bit_field11_7, vs2, fs1, vl);
69+
}
70+
71+
/*
72+
** test_sf_vc_fv_se_u16m8:
73+
** ...
74+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
75+
** ...
76+
*/
77+
78+
void test_sf_vc_fv_se_u16m8(const int bit_field26, const int bit_field11_7, vuint16m8_t vs2, float16_t fs1, size_t vl)
79+
{
80+
__riscv_sf_vc_fv_se_u16m8(bit_field26, bit_field11_7, vs2, fs1, vl);
81+
}
82+
83+
/*
84+
** test_sf_vc_fv_se_u32mf2:
85+
** ...
86+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
87+
** ...
88+
*/
89+
90+
void test_sf_vc_fv_se_u32mf2(const int bit_field26, const int bit_field11_7, vuint32mf2_t vs2, float32_t fs1, size_t vl)
91+
{
92+
__riscv_sf_vc_fv_se_u32mf2(bit_field26, bit_field11_7, vs2, fs1, vl);
93+
}
94+
95+
/*
96+
** test_sf_vc_fv_se_u32m1:
97+
** ...
98+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
99+
** ...
100+
*/
101+
102+
void test_sf_vc_fv_se_u32m1(const int bit_field26, const int bit_field11_7, vuint32m1_t vs2, float32_t fs1, size_t vl)
103+
{
104+
__riscv_sf_vc_fv_se_u32m1(bit_field26, bit_field11_7, vs2, fs1, vl);
105+
}
106+
107+
/*
108+
** test_sf_vc_fv_se_u32m2:
109+
** ...
110+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
111+
** ...
112+
*/
113+
114+
void test_sf_vc_fv_se_u32m2(const int bit_field26, const int bit_field11_7, vuint32m2_t vs2, float32_t fs1, size_t vl)
115+
{
116+
__riscv_sf_vc_fv_se_u32m2(bit_field26, bit_field11_7, vs2, fs1, vl);
117+
}
118+
119+
/*
120+
** test_sf_vc_fv_se_u32m4:
121+
** ...
122+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
123+
** ...
124+
*/
125+
126+
void test_sf_vc_fv_se_u32m4(const int bit_field26, const int bit_field11_7, vuint32m4_t vs2, float32_t fs1, size_t vl)
127+
{
128+
__riscv_sf_vc_fv_se_u32m4(bit_field26, bit_field11_7, vs2, fs1, vl);
129+
}
130+
131+
/*
132+
** test_sf_vc_fv_se_u32m8:
133+
** ...
134+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
135+
** ...
136+
*/
137+
138+
void test_sf_vc_fv_se_u32m8(const int bit_field26, const int bit_field11_7, vuint32m8_t vs2, float32_t fs1, size_t vl)
139+
{
140+
__riscv_sf_vc_fv_se_u32m8(bit_field26, bit_field11_7, vs2, fs1, vl);
141+
}
142+
143+
/*
144+
** test_sf_vc_fv_se_u64m1:
145+
** ...
146+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
147+
** ...
148+
*/
149+
150+
void test_sf_vc_fv_se_u64m1(const int bit_field26, const int bit_field11_7, vuint64m1_t vs2, float64_t fs1, size_t vl)
151+
{
152+
__riscv_sf_vc_fv_se_u64m1(bit_field26, bit_field11_7, vs2, fs1, vl);
153+
}
154+
155+
/*
156+
** test_sf_vc_fv_se_u64m2:
157+
** ...
158+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
159+
** ...
160+
*/
161+
162+
void test_sf_vc_fv_se_u64m2(const int bit_field26, const int bit_field11_7, vuint64m2_t vs2, float64_t fs1, size_t vl)
163+
{
164+
__riscv_sf_vc_fv_se_u64m2(bit_field26, bit_field11_7, vs2, fs1, vl);
165+
}
166+
167+
/*
168+
** test_sf_vc_fv_se_u64m4:
169+
** ...
170+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
171+
** ...
172+
*/
173+
174+
void test_sf_vc_fv_se_u64m4(const int bit_field26, const int bit_field11_7, vuint64m4_t vs2, float64_t fs1, size_t vl)
175+
{
176+
__riscv_sf_vc_fv_se_u64m4(bit_field26, bit_field11_7, vs2, fs1, vl);
177+
}
178+
179+
/*
180+
** test_sf_vc_fv_se_u64m8:
181+
** ...
182+
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
183+
** ...
184+
*/
185+
186+
void test_sf_vc_fv_se_u64m8(const int bit_field26, const int bit_field11_7, vuint64m8_t vs2, float64_t fs1, size_t vl)
187+
{
188+
__riscv_sf_vc_fv_se_u64m8(bit_field26, bit_field11_7, vs2, fs1, vl);
189+
}
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
/* { dg-do compile } */
2+
/* { dg-options "-march=rv64gcv_xsfvcp -mabi=lp64d -O3" } */
3+
/* { dg-final { check-function-bodies "**" "" } } */
4+
5+
#include "riscv_vector.h"
6+
7+
typedef _Float16 float16_t;
8+
typedef float float32_t;
9+
typedef double float64_t;
10+
11+
12+
/*
13+
** test_sf_vc_fvv_se_u16mf4:
14+
** ...
15+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
16+
** ...
17+
*/
18+
19+
void test_sf_vc_fvv_se_u16mf4(const int bit_field26, vuint16mf4_t vd, vuint16mf4_t vs2, float16_t fs1, size_t vl)
20+
{
21+
__riscv_sf_vc_fvv_se_u16mf4(bit_field26, vd, vs2, fs1, vl);
22+
}
23+
24+
/*
25+
** test_sf_vc_fvv_se_u16mf2:
26+
** ...
27+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
28+
** ...
29+
*/
30+
31+
void test_sf_vc_fvv_se_u16mf2(const int bit_field26, vuint16mf2_t vd, vuint16mf2_t vs2, float16_t fs1, size_t vl)
32+
{
33+
__riscv_sf_vc_fvv_se_u16mf2(bit_field26, vd, vs2, fs1, vl);
34+
}
35+
36+
/*
37+
** test_sf_vc_fvv_se_u16m1:
38+
** ...
39+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
40+
** ...
41+
*/
42+
43+
void test_sf_vc_fvv_se_u16m1(const int bit_field26, vuint16m1_t vd, vuint16m1_t vs2, float16_t fs1, size_t vl)
44+
{
45+
__riscv_sf_vc_fvv_se_u16m1(bit_field26, vd, vs2, fs1, vl);
46+
}
47+
48+
/*
49+
** test_sf_vc_fvv_se_u16m2:
50+
** ...
51+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
52+
** ...
53+
*/
54+
55+
void test_sf_vc_fvv_se_u16m2(const int bit_field26, vuint16m2_t vd, vuint16m2_t vs2, float16_t fs1, size_t vl)
56+
{
57+
__riscv_sf_vc_fvv_se_u16m2(bit_field26, vd, vs2, fs1, vl);
58+
}
59+
60+
/*
61+
** test_sf_vc_fvv_se_u16m4:
62+
** ...
63+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
64+
** ...
65+
*/
66+
67+
void test_sf_vc_fvv_se_u16m4(const int bit_field26, vuint16m4_t vd, vuint16m4_t vs2, float16_t fs1, size_t vl)
68+
{
69+
__riscv_sf_vc_fvv_se_u16m4(bit_field26, vd, vs2, fs1, vl);
70+
}
71+
72+
/*
73+
** test_sf_vc_fvv_se_u16m8:
74+
** ...
75+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
76+
** ...
77+
*/
78+
79+
void test_sf_vc_fvv_se_u16m8(const int bit_field26, vuint16m8_t vd, vuint16m8_t vs2, float16_t fs1, size_t vl)
80+
{
81+
__riscv_sf_vc_fvv_se_u16m8(bit_field26, vd, vs2, fs1, vl);
82+
}
83+
84+
/*
85+
** test_sf_vc_fvv_se_u32mf2:
86+
** ...
87+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
88+
** ...
89+
*/
90+
91+
void test_sf_vc_fvv_se_u32mf2(const int bit_field26, vuint32mf2_t vd, vuint32mf2_t vs2, float32_t fs1, size_t vl)
92+
{
93+
__riscv_sf_vc_fvv_se_u32mf2(bit_field26, vd, vs2, fs1, vl);
94+
}
95+
96+
/*
97+
** test_sf_vc_fvv_se_u32m1:
98+
** ...
99+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
100+
** ...
101+
*/
102+
103+
void test_sf_vc_fvv_se_u32m1(const int bit_field26, vuint32m1_t vd, vuint32m1_t vs2, float32_t fs1, size_t vl)
104+
{
105+
__riscv_sf_vc_fvv_se_u32m1(bit_field26, vd, vs2, fs1, vl);
106+
}
107+
108+
/*
109+
** test_sf_vc_fvv_se_u32m2:
110+
** ...
111+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
112+
** ...
113+
*/
114+
115+
void test_sf_vc_fvv_se_u32m2(const int bit_field26, vuint32m2_t vd, vuint32m2_t vs2, float32_t fs1, size_t vl)
116+
{
117+
__riscv_sf_vc_fvv_se_u32m2(bit_field26, vd, vs2, fs1, vl);
118+
}
119+
120+
/*
121+
** test_sf_vc_fvv_se_u32m4:
122+
** ...
123+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
124+
** ...
125+
*/
126+
127+
void test_sf_vc_fvv_se_u32m4(const int bit_field26, vuint32m4_t vd, vuint32m4_t vs2, float32_t fs1, size_t vl)
128+
{
129+
__riscv_sf_vc_fvv_se_u32m4(bit_field26, vd, vs2, fs1, vl);
130+
}
131+
132+
/*
133+
** test_sf_vc_fvv_se_u32m8:
134+
** ...
135+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
136+
** ...
137+
*/
138+
139+
void test_sf_vc_fvv_se_u32m8(const int bit_field26, vuint32m8_t vd, vuint32m8_t vs2, float32_t fs1, size_t vl)
140+
{
141+
__riscv_sf_vc_fvv_se_u32m8(bit_field26, vd, vs2, fs1, vl);
142+
}
143+
144+
/*
145+
** test_sf_vc_fvv_se_u64m1:
146+
** ...
147+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
148+
** ...
149+
*/
150+
151+
void test_sf_vc_fvv_se_u64m1(const int bit_field26, vuint64m1_t vd, vuint64m1_t vs2, float64_t fs1, size_t vl)
152+
{
153+
__riscv_sf_vc_fvv_se_u64m1(bit_field26, vd, vs2, fs1, vl);
154+
}
155+
156+
/*
157+
** test_sf_vc_fvv_se_u64m2:
158+
** ...
159+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
160+
** ...
161+
*/
162+
163+
void test_sf_vc_fvv_se_u64m2(const int bit_field26, vuint64m2_t vd, vuint64m2_t vs2, float64_t fs1, size_t vl)
164+
{
165+
__riscv_sf_vc_fvv_se_u64m2(bit_field26, vd, vs2, fs1, vl);
166+
}
167+
168+
/*
169+
** test_sf_vc_fvv_se_u64m4:
170+
** ...
171+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
172+
** ...
173+
*/
174+
175+
void test_sf_vc_fvv_se_u64m4(const int bit_field26, vuint64m4_t vd, vuint64m4_t vs2, float64_t fs1, size_t vl)
176+
{
177+
__riscv_sf_vc_fvv_se_u64m4(bit_field26, vd, vs2, fs1, vl);
178+
}
179+
180+
/*
181+
** test_sf_vc_fvv_se_u64m8:
182+
** ...
183+
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
184+
** ...
185+
*/
186+
187+
void test_sf_vc_fvv_se_u64m8(const int bit_field26, vuint64m8_t vd, vuint64m8_t vs2, float64_t fs1, size_t vl)
188+
{
189+
__riscv_sf_vc_fvv_se_u64m8(bit_field26, vd, vs2, fs1, vl);
190+
}

0 commit comments

Comments
 (0)