Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/bug-10-2.c

raw
1 /* { dg-do run { target { rv64 } } } */
2 /* { dg-require-effective-target rv64 } */
3 /* { dg-require-effective-target riscv_v_ok } */
4 /* { dg-require-effective-target riscv_zvfh_ok } */
5 /* { dg-options " -march=rv64gcv_zvfh -mabi=lp64d -O2" } */
6
7 #include "riscv_vector.h"
8
9 int8_t a[1];
10 uint16_t b[1];
11 float c[1], n[1];
12 uint16_t d[1];
13 uint8_t e[1];
14 uint16_t f[1];
15 _Float16 g[1], k[1], m[1], p[1];
16 uint16_t i[1];
17 int8_t j[1];
18 uint8_t o[1];
19 uint32_t l[1];
20 uint16_t q[1];
21 uint32_t r[1];
22 uint32_t s[1];
23 int16_t t[1];
24 int main()
25 {
26 int u = 25;
27 int8_t *v = a;
28 uint32_t *w;
29 uint16_t *aa = b;
30 float *ab = c, *as = n;
31 uint32_t *ad;
32 uint16_t *ah = f;
33 _Float16 *ai = g, *aj = k, *an = m, *au = p;
34 int32_t *ak;
35 int16_t *al;
36 uint16_t *am = i;
37 int8_t *ao = j;
38 uint8_t *ap = o;
39 uint32_t *aq = l;
40 uint16_t *ar = q;
41 uint32_t *at = r;
42 uint32_t *av = s;
43 int32_t *ax;
44 int16_t *ay = t;
45 for (size_t az; u; u -= az)
46 {
47 az = __riscv_vsetvl_e32m8(u);
48 vint8m2_t ba = __riscv_vle8_v_i8m2(v, az);
49 vbool4_t bb = __riscv_vmseq_vx_i8m2_b4(ba, 1, az);
50 vuint16m4_t bc = __riscv_vsll_vx_u16m4(__riscv_vid_v_u16m4(az), 2, az);
51 vuint32m8_t bd = __riscv_vsll_vx_u32m8(__riscv_vid_v_u32m8(az), 1, az);
52 vuint32m8_t be = __riscv_vluxei16_v_u32m8_m(bb, w, bc, az);
53 vuint16m4_t bf;
54 __riscv_vsuxei16_v_u32m8_m(bb, aq, bf, be, az);
55 vuint8m2_t bg = __riscv_vsll_vx_u8m2(__riscv_vid_v_u8m2(az), 1, az);
56 vuint16m4_t bh = __riscv_vloxei8_v_u16m4(aa, bg, az);
57 vfloat16m4_t bi;
58 vuint16m4_t bj = __riscv_vsll_vx_u16m4(__riscv_vid_v_u16m4(az), 1, az);
59 vint16m4_t bk = __riscv_vloxei32_v_i16m4_m(bb, al, bd, az);
60 __riscv_vsse16_v_u16m4(ar, 2, bh, az);
61 vuint16m4_t bl = __riscv_vloxei16_v_u16m4(d, bj, az);
62 vfloat16m4_t bm = __riscv_vle16_v_f16m4(ai, az);
63 vuint16m4_t bn = __riscv_vlse16_v_u16m4(ah, 2, az);
64 vint32m8_t bo = __riscv_vle32_v_i32m8_m(bb, ak, az);
65 vfloat16m1_t bp = __riscv_vle16_v_f16m1(aj, az);
66 vuint16m4_t bq = __riscv_vrgatherei16_vv_u16m4(bl, bn, az);
67 __riscv_vse16_v_u16m4(am, bq, az);
68 vfloat16m1_t br = __riscv_vfredusum_vs_f16m4_f16m1_m(bb, bm, bp, az);
69 vuint8m2_t bs;
70 vuint32m8_t bt;
71 __riscv_vse16_v_f16m1(an, br, az);
72 vfloat32m8_t bu = __riscv_vloxei8_v_f32m8(ab, bs, az);
73 __riscv_vse16_v_i16m4(ay, bk, az);
74 bi = __riscv_vfmv_s_f_f16m4(1, az);
75 __riscv_vse16_v_f16m4(au, bi, az);
76 vuint16m4_t bw = __riscv_vsll_vx_u16m4(__riscv_vid_v_u16m4(az), 0, az);
77 vuint32m8_t by = __riscv_vle32_v_u32m8_m(bb, ad, az);
78 bt = __riscv_vmv_s_x_u32m8(3090659, az);
79 __riscv_vse32_v_u32m8(at, bt, az);
80 vuint8m2_t bz = __riscv_vloxei16_v_u8m2(e, bw, az);
81 __riscv_vse32_v_u32m8(av, by, az);
82 vint8m2_t cd;
83 __riscv_vse8_v_i8m2(ao, cd, az);
84 __riscv_vsse32_v_i32m8_m(bb, ax, 4, bo, az);
85 __riscv_vse32_v_f32m8(as, bu, az);
86 vuint16m4_t cf;
87 __riscv_vsoxei16_v_u32m8(aq, cf, be, az);
88 vuint8m2_t cg = __riscv_vmulhu_vx_u8m2(bz, 0, az);
89 vuint32m8_t ch = __riscv_vsll_vx_u32m8(__riscv_vid_v_u32m8(az), 0, az);
90 __riscv_vsoxei32_v_u8m2(ap, ch, cg, az);
91 }
92 return 0;
93 }