1 /* { dg-require-effective-target vect_int } */
15 unsigned char ub
[N
*2];
19 unsigned char check_diff
= 2;
22 main1 (unsigned char x
, unsigned char max_result
, unsigned char min_result
, s
*arr
)
25 unsigned char udiff
= 2;
26 unsigned char umax
= x
;
27 unsigned char umin
= x
;
28 unsigned char ua1
[N
*2];
32 for (i
= 0; i
< N
; i
++) {
33 udiff
+= (unsigned char) (ub
[i
] - uc
[i
]);
35 ua1
[2*i
+1] = ub
[2*i
+1];
38 out
[i
].d
= pIn
->d
- 1;
39 out
[i
].b
= pIn
->b
- 4;
40 out
[i
].c
= pIn
->c
- 8;
41 out
[i
].a
= pIn
->a
- 3;
46 for (i
= 0; i
< N
; i
++) {
47 if (ua1
[2*i
] != ub
[2*i
]
48 || ua1
[2*i
+1] != ub
[2*i
+1]
49 || out
[i
].a
!= arr
[i
].a
- 3
50 || out
[i
].b
!= arr
[i
].b
- 4
51 || out
[i
].c
!= arr
[i
].c
- 8
52 || out
[i
].d
!= arr
[i
].d
- 1)
57 if (udiff
!= check_diff
)
68 for (i
= 1; i
< N
; i
++) {
69 ub
[i
] = (i
%5 == 0)?i
*3:i
;
71 check_diff
+= (unsigned char) (ub
[i
] - uc
[i
]);
72 if (y
) /* Avoid vectorization. */
75 for (; i
< 2*N
; i
++) {
77 if (y
) /* Avoid vectorization. */
81 for (i
= 0; i
< N
; i
++)
84 arr
[i
].b
= i
* 2 + 10;
92 main1 (100, 100, 1, arr
);
93 main1 (0, 15, 0, arr
);
97 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && ilp32 } } } } */
98 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { vect_no_align && ilp32 } } } } */
99 /* { dg-final { cleanup-tree-dump "vect" } } */