1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_pack_trunc } */
3 /* { dg-require-effective-target vect_unpack } */
4 /* { dg-require-effective-target vect_hw_misalign } */
8 void __attribute__((noinline
,noclone
))
9 testi (int *p
, short *q
, int stride
, int n
)
12 for (i
= 0; i
< n
; ++i
)
14 q
[i
*4+0] = p
[i
*stride
+0];
15 q
[i
*4+1] = p
[i
*stride
+1];
16 q
[i
*4+2] = p
[i
*stride
+2];
17 q
[i
*4+3] = p
[i
*stride
+3];
21 void __attribute__((noinline
,noclone
))
22 testi2 (int *q
, short *p
, int stride
, int n
)
25 for (i
= 0; i
< n
; ++i
)
27 q
[i
*4+0] = p
[i
*stride
+0];
28 q
[i
*4+1] = p
[i
*stride
+1];
29 q
[i
*4+2] = p
[i
*stride
+2];
30 q
[i
*4+3] = p
[i
*stride
+3];
37 extern void abort (void);
45 for (i
= 0; i
< 256; ++i
)
48 __asm__
volatile ("");
50 testi (ia
, sa
, 8, 32);
52 for (i
= 0; i
< 128; ++i
)
53 if (sa
[i
] != ia
[(i
/ 4) * 8 + i
% 4])
56 for (i
= 0; i
< 256; ++i
)
59 __asm__
volatile ("");
61 testi2 (ia
, sa
, 8, 32);
63 for (i
= 0; i
< 128; ++i
)
64 if (ia
[i
] != sa
[(i
/ 4) * 8 + i
% 4])
70 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */