Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-mult-half-u8.c
blob607f3178f903efe8193faa9c0de5ce658804b0fb
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 /* { dg-additional-options "-fno-ipa-icf" } */
5 /* { dg-additional-options "-mlasx" { target loongarch*-*-*} } */
7 #include "tree-vect.h"
9 #define N 32
10 #define COEF 32470
12 unsigned char in[N];
13 int out[N];
15 __attribute__ ((noinline)) void
16 foo ()
18 int i;
20 for (i = 0; i < N; i++)
21 out[i] = in[i] * COEF;
24 __attribute__ ((noinline)) void
25 bar ()
27 int i;
29 for (i = 0; i < N; i++)
30 out[i] = COEF * in[i];
33 int main (void)
35 int i;
37 check_vect ();
39 for (i = 0; i < N; i++)
41 in[i] = i;
42 __asm__ volatile ("");
45 foo ();
47 #pragma GCC novector
48 for (i = 0; i < N; i++)
49 if (out[i] != in[i] * COEF)
50 abort ();
52 bar ();
54 #pragma GCC novector
55 for (i = 0; i < N; i++)
56 if (out[i] != in[i] * COEF)
57 abort ();
59 return 0;
62 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_widen_mult_hi_to_si } } } */
63 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
64 /* { dg-final { scan-tree-dump-times "pattern recognized" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */