Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse5-shift2-vector.c
blobc0d97bc3d4aba1159c2ada02d4918599c2b2fc91
1 /* Test that the compiler properly optimizes vector shift instructions into
2 psha/pshl 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 int i32[SIZE];
17 unsigned u32[SIZE];
18 } a, b, c;
20 void
21 right_sign_shift32 (void)
23 int i;
25 for (i = 0; i < SIZE; i++)
26 a.i32[i] = b.i32[i] >> c.i32[i];
29 int main ()
31 right_sign_shfit32 ();
32 exit (0);
35 /* { dg-final { scan-assembler "pshad" } } */