gcc/testsuite/gcc.dg/vect/slp-8.c
raw| 1 | /* { dg-require-effective-target vect_int } */ |
| 2 | |
| 3 | #include <stdarg.h> |
| 4 | #include "tree-vect.h" |
| 5 | |
| 6 | #define N 32 |
| 7 | |
| 8 | int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 9 | |
| 10 | int main1 () |
| 11 | { |
| 12 | int i; |
| 13 | float fa[N]; |
| 14 | |
| 15 | /* int -> float */ |
| 16 | for (i = 0; i < N/4; i++) |
| 17 | { |
| 18 | fa[4*i] = (float) ib[4*i]; |
| 19 | fa[4*i + 1] = (float) ib[4*i + 1]; |
| 20 | fa[4*i + 2] = (float) ib[4*i + 2]; |
| 21 | fa[4*i + 3] = (float) ib[4*i + 3]; |
| 22 | } |
| 23 | |
| 24 | /* check results: */ |
| 25 | #pragma GCC novector |
| 26 | for (i = 0; i < N/4; i++) |
| 27 | { |
| 28 | if (fa[4*i] != (float) ib[4*i] |
| 29 | || fa[4*i + 1] != (float) ib[4*i + 1] |
| 30 | || fa[4*i + 2] != (float) ib[4*i + 2] |
| 31 | || fa[4*i + 3] != (float) ib[4*i + 3]) |
| 32 | abort (); |
| 33 | } |
| 34 | |
| 35 | return 0; |
| 36 | } |
| 37 | |
| 38 | int main (void) |
| 39 | { |
| 40 | check_vect (); |
| 41 | |
| 42 | return main1 (); |
| 43 | } |
| 44 | |
| 45 | /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */ |
| 46 | /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */ |