Debian Codegraph @

gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s315.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 s315(struct args_t * func_args)
10 {
11 // reductions
12 // if to max with index reductio 1 dimension
13
14 initialise_arrays(__func__);
15
16 for (int i = 0; i < LEN_1D; i++)
17 a[i] = (i * 7) % LEN_1D;
18
19 real_t x, chksum;
20 int index;
21 for (int nl = 0; nl < iterations; nl++) {
22 x = a[0];
23 index = 0;
24 for (int i = 0; i < LEN_1D; ++i) {
25 if (a[i] > x) {
26 x = a[i];
27 index = i;
28 }
29 }
30 chksum = x + (real_t) index;
31 dummy(a, b, c, d, e, aa, bb, cc, chksum);
32 }
33
34 return index + x + 1;
35 }
36
37 int main (int argc, char **argv)
38 {
39 int n1 = 1;
40 int n3 = 1;
41 int* ip;
42 real_t s1,s2;
43 init(&ip, &s1, &s2);
44
45 run(&s315, "s315", NULL);
46
47 return 0;
48 }
49
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */