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