2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / xop-rotate2-vector.c
blobf20e5416cba3ed6c4ee1ed5a4c76784b99e564db
1 /* Test that the compiler properly optimizes vector rotate instructions vector
2 into prot on XOP systems. */
4 /* { dg-do compile { target { ! ia32 } } } */
5 /* { dg-options "-O2 -mxop -mno-avx2 -ftree-vectorize" } */
7 extern void exit (int);
8 extern void right_rotate (void);
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 right_rotate32_b (void)
22 int i;
24 for (i = 0; i < SIZE; i++)
25 a.u32[i] = (b.u32[i] >> ((sizeof (int) * 8) - 4)) | (b.u32[i] << 4);
28 int
29 main ()
31 right_rotate ();
32 exit (0);
35 /* { dg-final { scan-assembler "vprot" } } */