Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/scalar_move-4.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv32gcv -mabi=ilp32d -fno-schedule-insns -fno-schedule-insns2 -O3" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4
5 #include "riscv_vector.h"
6
7
8 /*
9 ** foo1:
10 ** flw\t[a-x0-9]+,0\([a-x0-9]+\)
11 ** ret
12 */
13 float foo1 (void *base, size_t vl)
14 {
15 vfloat32m1_t v = *(vfloat32m1_t*)base;
16 float scalar = __riscv_vfmv_f_s_f32m1_f32 (v);
17 return scalar;
18 }
19
20 /*
21 ** foo2:
22 ** flw\t[a-x0-9]+,0\([a-x0-9]+\)
23 ** ret
24 */
25 float foo2 (void *base, size_t vl)
26 {
27 vfloat32mf2_t v = *(vfloat32mf2_t*)base;
28 float scalar = __riscv_vfmv_f_s_f32mf2_f32 (v);
29 return scalar;
30 }
31
32 /*
33 ** foo3:
34 ** flw\t[a-x0-9]+,4\([a-x0-9]+\)
35 ** ret
36 */
37 float foo3 (float *base, size_t vl)
38 {
39 vfloat32m1_t v = *(vfloat32m1_t*)(base+1);
40 float scalar = __riscv_vfmv_f_s_f32m1_f32 (v);
41 return scalar;
42 }
43
44 /*
45 ** foo4:
46 ** lw\t[a-x0-9]+,4\([a-x0-9]+\)
47 ** ret
48 */
49 int32_t foo4 (float *base, size_t vl)
50 {
51 vfloat32m1_t v = *(vfloat32m1_t*)(base+1);
52 float scalar = __riscv_vfmv_f_s_f32m1_f32 (v);
53 return *(int32_t*)&scalar;
54 }