Debian Codegraph @

gcc/testsuite/gcc.target/riscv/pr116590.c

raw
1 /* { dg-do assemble } */
2 /* { dg-options "-march=rv64gc_zfh_xtheadvector -mabi=lp64d" } */
3 typedef long unsigned int size_t;
4 #pragma riscv intrinsic "vector"
5
6
7 void vmv8r()
8 {
9 float x[32];
10
11 size_t vl = __riscv_vsetvl_e32m8(32);
12 vfloat32m8_t _p = __riscv_vle32_v_f32m8(x, vl);
13
14 _p = __riscv_vfmacc_vf_f32m8(__riscv_vfmv_v_f_f32m8(0.5f, vl), 1.442, _p, vl);
15
16 __riscv_vse32_v_f32m8(x, _p, vl);
17 }
18
19 void gen_vmv8r(float* ptr, int n)
20 {
21 while (n > 0)
22 {
23 size_t vl = __riscv_vsetvl_e32m8(n);
24
25 vfloat32m8_t _p = __riscv_vle32_v_f32m8(ptr, vl);
26
27 _p = __riscv_vfmacc_vf_f32m8(__riscv_vfmv_v_f_f32m8(0.5f, vl), 1.4f, _p, vl);
28
29 __riscv_vse32_v_f32m8(ptr, _p, vl);
30
31 ptr += vl;
32 n -= vl;
33 }
34 }
35
36 void no_vmv8r(float* ptr, int n)
37 {
38 size_t vl0 = __riscv_vsetvl_e32m8(n);
39 vfloat32m8_t _a = __riscv_vfmv_v_f_f32m8(0.5f, vl0);
40
41 while (n > 0)
42 {
43 size_t vl = __riscv_vsetvl_e32m8(n);
44
45 vfloat32m8_t _p = __riscv_vle32_v_f32m8(ptr, vl);
46
47 _p = __riscv_vfmacc_vf_f32m8(_a, 1.4f, _p, vl);
48
49 __riscv_vse32_v_f32m8(ptr, _p, vl);
50
51 ptr += vl;
52 n -= vl;
53 }
54 }