Debian Codegraph @

gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s31111.c

raw
1 /* This file is distributed under the University of Illinois Open Source
2 License. See license.txt for details. */
3
4 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
5 /* { dg-require-effective-target vect_float } */
6
7 #include "tsvc.h"
8
9 real_t test(real_t* A){
10 real_t s = (real_t)0.0;
11 for (int i = 0; i < 4; i++)
12 s += A[i];
13 return s;
14 }
15
16 real_t s31111(struct args_t * func_args)
17 {
18 // reductions
19 // sum reduction
20
21 initialise_arrays(__func__);
22
23 real_t sum;
24 for (int nl = 0; nl < 2000*iterations; nl++) {
25 sum = (real_t)0.;
26 sum += test(a);
27 sum += test(&a[4]);
28 sum += test(&a[8]);
29 sum += test(&a[12]);
30 sum += test(&a[16]);
31 sum += test(&a[20]);
32 sum += test(&a[24]);
33 sum += test(&a[28]);
34 dummy(a, b, c, d, e, aa, bb, cc, sum);
35 }
36
37 return calc_checksum(__func__);
38 }
39
40 int main (int argc, char **argv)
41 {
42 int n1 = 1;
43 int n3 = 1;
44 int* ip;
45 real_t s1,s2;
46 init(&ip, &s1, &s2);
47
48 run(&s31111, "s31111", NULL);
49
50 return 0;
51 }
52
53
54 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */