Debian Codegraph @

gcc/testsuite/gcc.target/arm/mve/intrinsics/pr124870.c

raw
1 /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
2 /* { dg-add-options arm_v8_1m_mve_fp } */
3 /* { dg-additional-options "-O2" } */
4
5 /* PR target/124870. */
6
7 #include <arm_mve.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13 void fn (int n, uint32_t *strides, float32_t *f)
14 {
15 uint32x4_t vecScGathAddr = vld1q_u32(strides);
16 float32x4_t vecA = vldrwq_gather_base_wb_f32(&vecScGathAddr, 64);
17 float32x4_t vecB = vecA;
18 int i;
19 for (i = 0; i < n; ++i)
20 {
21 vecA = vldrwq_gather_base_wb_f32(&vecScGathAddr, 64);
22 vecB = vaddq_f32 (vecB, vecA);
23 }
24 vstrwq_f32 (f, vecB);
25 }
26
27 #ifdef __cplusplus
28 }
29 #endif
30
31 /* { dg-final { scan-assembler-times "vadd.f32\tq\[0-9\]+, q\[0-9\]+, q\[0-9\]+" 1 } } */