Stop only if there aren't any usable algorithms
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse2-vec-1.c
blobab2ca5b221ac5065a26c43385a4f1748b6c2271f
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse2" } */
3 /* { dg-require-effective-target sse2 } */
5 #include "sse2-check.h"
7 #include <emmintrin.h>
9 #define msk0 0
10 #define msk1 1
12 static void
13 sse2_test (void)
15 union
17 __m128d x;
18 double d[2];
19 } val1;
20 double res[2];
21 int masks[2];
22 int i;
24 val1.d[0] = 23.;
25 val1.d[1] = 45;
27 res[0] = __builtin_ia32_vec_ext_v2df ((__v2df)val1.x, msk0);
28 res[1] = __builtin_ia32_vec_ext_v2df ((__v2df)val1.x, msk1);
30 masks[0] = msk0;
31 masks[1] = msk1;
33 for (i = 0; i < 2; i++)
34 if (res[i] != val1.d [masks[i]])
35 abort ();