aarch64: Fuse CMP+CSEL and CMP+CSET for -mcpu=neoverse-v2
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-mult-const-s16.c
blob53c9b84ca01630bd4b7de8f3c47c18deeab5e8f8
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
11 __attribute__ ((noinline)) void
12 foo (int *__restrict a,
13 short *__restrict b,
14 int n)
16 int i;
18 for (i = 0; i < n; i++)
19 a[i] = b[i] * 2333;
21 #pragma GCC novector
22 for (i = 0; i < n; i++)
23 if (a[i] != b[i] * 2333)
24 abort ();
27 __attribute__ ((noinline)) void
28 bar (int *__restrict a,
29 short *__restrict b,
30 int n)
32 int i;
34 for (i = 0; i < n; i++)
35 a[i] = b[i] * (short) 2333;
37 #pragma GCC novector
38 for (i = 0; i < n; i++)
39 if (a[i] != b[i] * (short) 2333)
40 abort ();
43 int main (void)
45 int i;
46 int a[N];
47 short b[N];
49 check_vect ();
51 for (i = 0; i < N; i++)
53 a[i] = 0;
54 b[i] = i;
55 __asm__ volatile ("");
58 foo (a, b, N);
59 bar (a, b, N);
60 return 0;
63 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_widen_mult_hi_to_si } } } */
64 /* { dg-final { scan-tree-dump-times {vect_recog_widen_mult_pattern: detected:[^\n]* 2333} 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
65 /* { dg-final { scan-tree-dump-times {widen_mult pattern recognized:[^\n]* 2333} 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */