1 /* PR tree-optimization/57233 */
2 /* { dg-do run { target { ilp32 || lp64 } } } */
3 /* { dg-options "-O2" } */
5 typedef unsigned V4
__attribute__((vector_size(4 * sizeof (int))));
6 typedef unsigned V8
__attribute__((vector_size(8 * sizeof (int))));
7 typedef unsigned V16
__attribute__((vector_size(16 * sizeof (int))));
12 __attribute__((noinline
)) void
15 a
= (a
<< 2) | (a
>> 30);
18 __attribute__((noinline
)) void
21 a
= (a
<< 30) | (a
>> 2);
24 __attribute__((noinline
)) void
27 a
= (a
<< b
) | (a
>> (32 - b
));
30 __attribute__((noinline
, noclone
)) void
33 a
= (a
<< x
) | (a
>> (32 - x
));
36 __attribute__((noinline
)) void
39 c
= (c
<< 2) | (c
>> 30);
42 __attribute__((noinline
)) void
45 c
= (c
<< 30) | (c
>> 2);
48 __attribute__((noinline
)) void
51 c
= (c
<< d
) | (c
>> (32 - d
));
54 __attribute__((noinline
, noclone
)) void
57 c
= (c
<< x
) | (c
>> (32 - x
));
60 __attribute__((noinline
)) void
63 e
= (e
<< 2) | (e
>> 30);
66 __attribute__((noinline
)) void
69 e
= (e
<< 30) | (e
>> 2);
72 __attribute__((noinline
)) void
75 e
= (e
<< f
) | (e
>> (32 - f
));
78 __attribute__((noinline
, noclone
)) void
81 e
= (e
<< x
) | (e
>> (32 - x
));
87 static unsigned x
= 0xdeadbeefU
;
88 static unsigned y
= 0x12347654U
;
89 static unsigned z
= 0x1a2b3c4dU
;
90 static unsigned w
= 0x87654321U
;
91 unsigned t
= x
^ (x
<< 11);
95 w
= w
^ (w
>> 19) ^ t
^ (t
>> 8);
100 init (unsigned int *p
, int count
, int mod
)
103 for (i
= 0; i
< count
; i
++)
105 unsigned int v
= r ();
113 check (unsigned int *p
, unsigned int *q
, int count
, unsigned int *s
, int ss
)
116 for (i
= 0; i
< count
; i
++)
120 if (p
[i
] != ((q
[i
] << ss
) | (q
[i
] >> (32 - ss
))))
128 init ((unsigned int *) &a
, 4, 0);
129 init ((unsigned int *) &b
, 4, 1);
130 init ((unsigned int *) &c
, 8, 0);
131 init ((unsigned int *) &d
, 8, 1);
132 init ((unsigned int *) &e
, 16, 0);
133 init ((unsigned int *) &f
, 16, 1);
140 check ((unsigned int *) &a
, (unsigned int *) &g
, 4, 0, 2);
141 check ((unsigned int *) &c
, (unsigned int *) &h
, 8, 0, 2);
142 check ((unsigned int *) &e
, (unsigned int *) &j
, 16, 0, 2);
149 check ((unsigned int *) &a
, (unsigned int *) &g
, 4, 0, 30);
150 check ((unsigned int *) &c
, (unsigned int *) &h
, 8, 0, 30);
151 check ((unsigned int *) &e
, (unsigned int *) &j
, 16, 0, 30);
158 check ((unsigned int *) &a
, (unsigned int *) &g
, 4, (unsigned int *) &b
, 0);
159 check ((unsigned int *) &c
, (unsigned int *) &h
, 8, (unsigned int *) &d
, 0);
160 check ((unsigned int *) &e
, (unsigned int *) &j
, 16, (unsigned int *) &f
, 0);
167 check ((unsigned int *) &a
, (unsigned int *) &g
, 4, 0, 5);
168 check ((unsigned int *) &c
, (unsigned int *) &h
, 8, 0, 5);
169 check ((unsigned int *) &e
, (unsigned int *) &j
, 16, 0, 5);