PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-perm-12.c
blob4d4c5344402e86a2c561647ee5b7dcf2e64f85ca
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_pack_trunc } */
3 /* { dg-additional-options "-msse4" { target { i?86-*-* x86_64-*-* } } } */
5 #include "tree-vect.h"
7 extern void abort (void);
9 unsigned char a[64];
10 short b[88];
12 void __attribute__((noinline))
13 test(unsigned char * __restrict__ dst, short * __restrict__ tptr)
15 int i;
16 for (i = 0; i < 8; i++)
18 dst[0] = (tptr[0] - tptr[0 + 3]);
19 dst[1] = (tptr[1] - tptr[1 + 3]);
20 dst[2] = (tptr[2] - tptr[2 + 3]);
21 dst[3] = (tptr[3] - tptr[3 + 3]);
22 dst[4] = (tptr[4] - tptr[4 + 3]);
23 dst[5] = (tptr[5] - tptr[5 + 3]);
24 dst[6] = (tptr[6] - tptr[6 + 3]);
25 dst[7] = (tptr[7] - tptr[7 + 3]);
26 dst += 8;
27 tptr += 11;
31 int main()
33 int i;
35 check_vect ();
37 for (i = 0; i < 88; ++i)
39 b[i] = i;
40 __asm__ volatile ("");
43 test (a, b);
45 for (i = 0; i < 64; ++i)
46 if (a[i] != 253)
47 abort ();
49 return 0;
52 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */