libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-mult-half.c
blobcd13d8269374bf8a5c8a9694abeffcc8a6e381d2
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 "-mlasx" { target loongarch*-*-*} } */
6 #include "tree-vect.h"
8 #define N 32
9 #define COEF 32470
10 #define COEF2 324700
12 unsigned char in[N];
13 int out[N];
14 int out2[N];
16 __attribute__ ((noinline)) void
17 foo (int a)
19 int i;
21 for (i = 0; i < N; i++)
23 out[i] = in[i] * COEF;
24 out2[i] = in[i] + a;
28 int main (void)
30 int i;
32 check_vect ();
34 for (i = 0; i < N; i++)
36 in[i] = i;
37 __asm__ volatile ("");
40 foo (COEF2);
42 #pragma GCC novector
43 for (i = 0; i < N; i++)
44 if (out[i] != in[i] * COEF || out2[i] != in[i] + COEF2)
45 abort ();
47 return 0;
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
51 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
52 /* { dg-final { scan-tree-dump-times "pattern recognized" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */