OSDN Git Service

* config.gcc (x86_64-*-*): Install mmintrin.h and xmmintrin.h.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / i386-sse-3.c
1 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-O2 -msse" } */
3
4 /* Test that the intrinsics compile with optimization.  These were not
5    tested in i386-sse-[12].c because these builtins require immediate
6    operands.  */
7
8 #include <xmmintrin.h>
9
10 __m128
11 test_shuf (void)
12 {
13   __m128 a = _mm_set1_ps (1.0);
14   __m128 b = _mm_set1_ps (2.0);
15   return _mm_shuffle_ps (a, b, _MM_SHUFFLE (0,1,2,3));
16 }
17
18 __m64
19 test_ins_ext (__m64 a)
20 {
21   return _mm_insert_pi16 (a, _mm_extract_pi16 (a, 0), 3);
22 }
23
24 __m64
25 test_shuf2 (__m64 a)
26 {
27   return _mm_shuffle_pi16 (a, 0xA5);
28 }
29
30 void
31 test_prefetch (char *p)
32 {
33   _mm_prefetch (p, _MM_HINT_T0);
34   _mm_prefetch (p+4, _MM_HINT_T1);
35   _mm_prefetch (p+8, _MM_HINT_T2);
36   _mm_prefetch (p+12, _MM_HINT_NTA);
37 }