(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-56.c
       1  /* Disabling epilogues until we find a better way to deal with scans.  */
       2  /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
       3  /* { dg-require-effective-target vect_float } */
       4  
       5  #include <stdarg.h>
       6  #include "tree-vect.h"
       7  
       8  #define N 256
       9  
      10  __attribute__ ((noinline))
      11  void bar (float *pa, float *pb, float *pc)
      12  {
      13    int i;
      14  
      15    /* check results:  */
      16    for (i = 0; i < N/2; i++)
      17      {
      18        if (pa[i] != (pb[i+1] * pc[i+1]))
      19          abort ();
      20      }
      21  
      22    return;
      23  }
      24  
      25  /* Unaligned pointer read accesses, aligned write access.
      26     The loop bound is known and divisible by the vectorization factor.
      27     No aliasing problems.
      28     vect-48.c is similar to this one with one difference:
      29          the alignment of the read accesses is unknown.
      30     vect-60.c is similar to this one with one difference:
      31          the loop bound is unknown.
      32     vect-57.c is similar to this one with two differences:
      33          aliasing is a problem, and the write access has unknown alignment.  */
      34  
      35  float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
      36  float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
      37  
      38  __attribute__ ((noinline)) int
      39  main1 ()
      40  {
      41    int i;
      42    float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
      43    float *pa = a;
      44    float *pb = b;
      45    float *pc = c;
      46  
      47    for (i = 0; i < N/2; i++)
      48      {
      49        pa[i] = pb[i+1] * pc[i+1];
      50      }
      51  
      52    /* check results:  */
      53    for (i = 0; i < N/2; i++)
      54      {
      55        if (pa[i] != (pb[i+1] * pc[i+1]))
      56          abort ();
      57      }
      58  
      59    return 0;
      60  }
      61  
      62  int main (void)
      63  {
      64    int i;
      65  
      66    check_vect ();
      67    main1 ();
      68  
      69    return 0;
      70  }
      71  
      72  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
      73  /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_element_align } xfail { ! vect_unaligned_possible } } } } */
      74  /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } xfail { ! vect_unaligned_possible } } } } */
      75  /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { { ! vect_element_align } || vect_element_align_preferred} } } } */
      76  /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align && { ! vect_element_align_preferred } } } } } */