cfgexpand: Expand comment on when non-var clobbers can show up
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-reduc-dot-s16a.c
blob000b2047fc005cfea1c9e27491ea398004080a71
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 } */
5 #include <stdarg.h>
6 #include "tree-vect.h"
8 #define N 64
9 #define DOT 43680
11 signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12 signed short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
14 /* short->int->int dot product.
15 Detected as a dot-product pattern.
16 Vectorized on targets that support dot-product for signed shorts. */
18 __attribute__ ((noinline)) int
19 foo (int len)
21 int i;
22 int result = 0;
24 for (i = 0; i < len; i++)
26 result += (X[i] * Y[i]);
28 return result;
32 int
33 main (void)
35 int i;
36 int dot;
38 check_vect ();
40 for (i = 0; i < N; i++)
42 X[i] = i;
43 Y[i] = N - i;
44 __asm__ volatile ("");
47 dot = foo (N);
48 if (dot != DOT)
49 abort ();
51 return 0;
54 /* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected(?:(?!Analysis failed).)*Analysis succeeded" 1 "vect" { target { vect_sdot_hi || vect_widen_mult_hi_to_si } } } } */
55 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_hi } } } */
56 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */