(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-widen-mult-half.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_int } */
       4  
       5  #include "tree-vect.h"
       6  
       7  #define N 32
       8  #define COEF 32470
       9  #define COEF2 324700
      10  
      11  unsigned char in[N];
      12  int out[N];
      13  int out2[N];
      14  
      15  __attribute__ ((noinline)) void
      16  foo (int a)
      17  {
      18    int i;
      19  
      20    for (i = 0; i < N; i++)
      21      {
      22        out[i] = in[i] * COEF;
      23        out2[i] = in[i] + a;
      24      }
      25  }
      26  
      27  int main (void)
      28  {
      29    int i;
      30  
      31    check_vect ();
      32  
      33    for (i = 0; i < N; i++)
      34      {
      35        in[i] = i;
      36        __asm__ volatile ("");
      37      }
      38  
      39    foo (COEF2);
      40  
      41    for (i = 0; i < N; i++)
      42      if (out[i] != in[i] * COEF || out2[i] != in[i] + COEF2)
      43        abort ();
      44  
      45    return 0;
      46  }
      47  
      48  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
      49  /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
      50  /* { dg-final { scan-tree-dump-times "pattern recognized" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
      51