OSDN Git Service

2008-08-28 Xuepeng Guo <xuepeng.guo@intel.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / sse2-psllw-2.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse2" } */
3
4 #ifndef CHECK_H
5 #define CHECK_H "sse2-check.h"
6 #endif
7
8 #ifndef TEST
9 #define TEST sse2_test
10 #endif
11
12 #include CHECK_H
13
14 #include <emmintrin.h>
15
16 static __m128i
17 __attribute__((noinline, unused))
18 test (__m128i s1, __m128i c)
19 {
20   return _mm_sll_epi16 (s1, c); 
21 }
22
23 static void
24 TEST (void)
25 {
26   union128i_w u, s;
27   union128i_q c;
28   short e[8] = {0};
29   int i;
30  
31   s.x = _mm_set_epi16 (1, 2, 3, 4, 5, 6, 0x7000, 0x9000);
32   c.x = _mm_set_epi64x (12, 13);
33
34   u.x = test (s.x, c.x);
35
36   if (c.a[0] < 16)
37     for (i = 0; i < 8; i++)
38       e[i] = s.a[i] << c.a[0]; 
39
40   if (check_union128i_w (u, e))
41     abort (); 
42 }