(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-widen-mult-u16.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 <stdarg.h>
       6  #include "tree-vect.h"
       7  
       8  #define N 64
       9  
      10  unsigned short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
      11  unsigned short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
      12  unsigned int result[N];
      13  
      14  /* unsigned short->unsigned int widening-mult.  */
      15  __attribute__ ((noinline)) int
      16  foo1(int len) {
      17    int i;
      18  
      19    for (i=0; i<len; i++) {
      20      result[i] = (unsigned int)(X[i] * Y[i]);
      21    }
      22  }
      23  
      24  int main (void)
      25  {
      26    int i;
      27  
      28    check_vect ();
      29  
      30    for (i=0; i<N; i++) {
      31      X[i] = i;
      32      Y[i] = 64-i;
      33      __asm__ volatile ("");
      34    }
      35  
      36    foo1 (N);
      37  
      38    for (i=0; i<N; i++) {
      39      if (result[i] != X[i] * Y[i])
      40        abort ();
      41    }
      42    
      43    return 0;
      44  }
      45  
      46  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */
      47  /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
      48  /* { dg-final { scan-tree-dump-times "pattern recognized" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
      49