PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / xop-rotate1-vector.c
bloba0b41681b41b45e708110f32cb279ced0d23a8fe
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);
9 typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
11 #define SIZE 10240
13 union {
14 __m128i i_align;
15 unsigned u32[SIZE];
16 } a, b, c;
18 void
19 left_rotate32 (void)
21 int i;
23 for (i = 0; i < SIZE; i++)
24 a.u32[i] = (b.u32[i] << ((sizeof (int) * 8) - 4)) | (b.u32[i] >> 4);
27 int
28 main ()
30 left_rotate32 ();
31 exit (0);
34 /* { dg-final { scan-assembler "vprotd" } } */