Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse5-rotate3-vector.c
blobde7272439ab44f5a21d08b731faf08c9a81ec026
1 /* Test that the compiler properly optimizes vector rotate instructions vector
2 into prot on SSE5 systems. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target lp64 } */
6 /* { dg-options "-O2 -msse5 -ftree-vectorize" } */
8 extern void exit (int);
10 typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
12 #define SIZE 10240
14 union {
15 __m128i i_align;
16 unsigned u32[SIZE];
17 } a, b, c;
19 void
20 vector_rotate32 (void)
22 int i;
24 for (i = 0; i < SIZE; i++)
25 a.u32[i] = (b.u32[i] >> ((sizeof (int) * 8) - c.u32[i])) | (b.u32[i] << c.u32[i]);
28 int main ()
30 vector_rotate32 ();
31 exit (0);
34 /* { dg-final { scan-assembler "protd" } } */