Debian Codegraph @

gcc/testsuite/g++.target/riscv/rvv/base/pr109244.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcv -mabi=lp64d -O2" } */
3 typedef int a;
4 using c = float;
5 template < typename > using e = int;
6 #pragma riscv intrinsic "vector"
7 template < typename, int, int f > struct aa {
8 using g = int;
9 template < typename > static constexpr int h() { return f; }
10 template < typename i > using ab = aa< i, 0, h< i >() >;
11 };
12 template < int f > struct p { using j = aa< float, 6, f >; };
13 template < int f > struct k { using j = typename p< f >::j; };
14 template < typename, int f > using ac = typename k< f >::j;
15 template < class ad > using l = typename ad::g;
16 template < class g, class ad > using ab = typename ad::ab< g >;
17 template < class ad > using ae = ab< e< ad >, ad >;
18 template < int m > vuint32mf2_t ai(aa< a, m, -1 >, a aj) {
19 return __riscv_vmv_v_x_u32mf2(aj, 0);
20 }
21 template < int m > vfloat32mf2_t ai(aa< c, m, -1 >, c);
22 template < class ad > using ak = decltype(ai(ad(), l< ad >()));
23 template < class ad > ak< ad > al(ad d) {
24 ae< decltype(d) > am;
25 return an(d, ai(am, 0));
26 }
27 template < typename g, int m > vuint8mf2_t ao(aa< g, m, -1 >, vuint32mf2_t n) {
28 return __riscv_vreinterpret_v_u32mf2_u8mf2(n);
29 }
30 template < int m > vuint32mf2_t ap(aa< a, m, -1 >, vuint8mf2_t n) {
31 return __riscv_vreinterpret_v_u8mf2_u32mf2(n);
32 }
33 template < typename g, int m > vuint8mf2_t ao(aa< g, m, -1 >, vfloat32mf2_t n) {
34 return __riscv_vreinterpret_v_u32mf2_u8mf2(
35 __riscv_vreinterpret_v_f32mf2_u32mf2(n));
36 }
37 template < int m > vfloat32mf2_t ap(aa< c, m, -1 >, vuint8mf2_t);
38 template < class ad, class aq > ak< ad > an(ad d, aq n) {
39 return ap(d, ao(d, n));
40 }
41 vbool64_t av(vuint32mf2_t, vuint32mf2_t);
42 template < class ad > bool ba(ad, vbool64_t);
43 template < class ad > using bb = decltype(al(ad()));
44 template < typename g > using be = ac< g, -1 >;
45 struct bf {
46 template < class ad > bool bh(ad, bb< ad > bi) {
47 ae< ad > am;
48 return ba(am, av(an(am, bi), al(am)));
49 }
50 };
51 int bo;
52 template < class ad, class bl, typename g > void o(ad d, bl bn, g) {
53 bb< ad > bq = al(d);
54 for (; bo;) {
55 int br = bn.bh(d, bq);
56 if (__builtin_expect(br, 0))
57 for (;;)
58 ;
59 }
60 }
61 template < class ad, class bl, typename g > void bs(ad d, bl bn, g) {
62 g bu;
63 o(d, bn, bu);
64 }
65 template < class ad, class bl, typename g >
66 void bv(ad d, bl bn, g *, int, g *bt) {
67 bs(d, bn, bt);
68 }
69 float by;
70 int bz;
71 float ca;
72 void b() {
73 be< float > d;
74 bf bn;
75 bv(d, bn, &by, bz, &ca);
76 }