| 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 s4116(struct args_t * func_args) |
| 10 |
{ |
| 11 |
// indirect addressing |
| 12 |
// more complicated sparse sdot |
| 13 |
// gather is required |
| 14 |
|
| 15 |
struct{int * __restrict__ a;int b;int c;} * x = func_args->arg_info; |
| 16 |
int * __restrict__ ip = x->a; |
| 17 |
int j = x->b; |
| 18 |
int inc = x->c; |
| 19 |
|
| 20 |
initialise_arrays(__func__); |
| 21 |
|
| 22 |
real_t sum; |
| 23 |
int off; |
| 24 |
for (int nl = 0; nl < 100*iterations; nl++) { |
| 25 |
sum = 0.; |
| 26 |
for (int i = 0; i < LEN_2D-1; i++) { |
| 27 |
off = inc + i; |
| 28 |
sum += a[off] * aa[j-1][ip[i]]; |
| 29 |
} |
| 30 |
dummy(a, b, c, d, e, aa, bb, cc, 0.); |
| 31 |
} |
| 32 |
|
| 33 |
return sum; |
| 34 |
} |
| 35 |
|
| 36 |
int main (int argc, char **argv) |
| 37 |
{ |
| 38 |
int n1 = 1; |
| 39 |
int n3 = 1; |
| 40 |
int* ip; |
| 41 |
real_t s1,s2; |
| 42 |
init(&ip, &s1, &s2); |
| 43 |
|
| 44 |
run(&s4116, "s4116", &(struct{int * a; int b; int c;}){ip, LEN_2D/2, n1}); |
| 45 |
|
| 46 |
return 0; |
| 47 |
} |
| 48 |
|
| 49 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |