OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / sse2-set-epi64x-1.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse2" } */
3
4 #include "sse2-check.h"
5
6 #ifdef DEBUG
7 #include <stdio.h>
8 #endif
9
10 #include <emmintrin.h>
11
12 static void
13 __attribute__((noinline))
14 test (unsigned long long *v)
15 {
16   union
17     {
18       __m128i x;
19       unsigned long long i[2];
20     } u;
21   unsigned int i;
22   
23   u.x = _mm_set_epi64x (v[1], v[0]);
24
25   for (i = 0; i < sizeof (v) / sizeof (v[0]); i++)
26     if (v[i] != u.i[i])
27       {
28 #ifdef DEBUG
29         printf ("%i: 0x%llx != 0x%llx\n", i, v[i], u.i[i]);
30 #endif
31         abort ();
32       }
33 }
34
35 static void
36 sse2_test (void)
37 {
38   unsigned long long v[2]
39     = { 0x7B5B546573745665LL, 0x63746F725D53475DLL };
40   test (v);
41 }