[committed] ft32 doesn't support trampolines.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx2-vect-mask-store-move1.c
blob6a47a09c8357777271ffc41eea04deaac4c61b6c
1 /* { dg-options "-O3 -mavx2 -fdump-tree-vect-details" } */
2 /* { dg-require-effective-target avx2 } */
3 /* Disabling epilogues until we find a better way to deal with scans. */
4 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
6 #include "avx2-check.h"
7 #define N 32
8 int *p1, *p2, *p3;
9 int c[N];
10 int p1ref[N], p2ref[N];
12 __attribute__((noinline, noclone)) void foo (int n)
14 int i;
15 for (i=0; i<n; i++)
16 if (c[i])
18 p1[i] += 1;
19 p2[i] = p3[i] +2;
23 void init ()
25 p1ref[0]=1; p2ref[0]=2;
26 p1ref[1]=3; p2ref[1]=5;
27 p1ref[2]=5; p2ref[2]=8;
28 p1ref[3]=7; p2ref[3]=11;
29 p1ref[4]=9; p2ref[4]=14;
30 p1ref[5]=11; p2ref[5]=17;
31 p1ref[6]=13; p2ref[6]=20;
32 p1ref[7]=15; p2ref[7]=23;
33 p1ref[8]=16; p2ref[8]=8;
34 p1ref[9]=18; p2ref[9]=9;
35 p1ref[10]=20; p2ref[10]=10;
36 p1ref[11]=22; p2ref[11]=11;
37 p1ref[12]=24; p2ref[12]=12;
38 p1ref[13]=26; p2ref[13]=13;
39 p1ref[14]=28; p2ref[14]=14;
40 p1ref[15]=30; p2ref[15]=15;
41 p1ref[16]=33; p2ref[16]=50;
42 p1ref[17]=35; p2ref[17]=53;
43 p1ref[18]=37; p2ref[18]=56;
44 p1ref[19]=39; p2ref[19]=59;
45 p1ref[20]=41; p2ref[20]=62;
46 p1ref[21]=43; p2ref[21]=65;
47 p1ref[22]=45; p2ref[22]=68;
48 p1ref[23]=47; p2ref[23]=71;
49 p1ref[24]=48; p2ref[24]=24;
50 p1ref[25]=50; p2ref[25]=25;
51 p1ref[26]=52; p2ref[26]=26;
52 p1ref[27]=54; p2ref[27]=27;
53 p1ref[28]=56; p2ref[28]=28;
54 p1ref[29]=58; p2ref[29]=29;
55 p1ref[30]=60; p2ref[30]=30;
56 p1ref[31]=62; p2ref[31]=31;
59 static void
60 avx2_test (void)
62 int * P = malloc (N * 3 * sizeof (int));
63 int i;
65 p1 = &P[0];
66 p2 = &P[N];
67 p3 = &P[2 * N];
68 for (i=0; i<N; i++) {
69 p1[i] = i + i;
70 p3[i] = i * 3;
71 p2[i] = i;
72 c[i] = (i >> 3) & 1? 0: 1;
74 init ();
75 foo (N);
76 for (i=0; i<N;i++)
77 if (p1[i] != p1ref[i] || p2[i] != p2ref[i])
78 abort ();
81 /* { dg-final { scan-tree-dump-times "Move stmt to created bb" 10 "vect" } } */