Merge from mainline (160224:163495).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / sse-set-ps-1.c
blob5a0c9b95d662a4d26287541d18dbc04e32aeb3e5
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse" } */
3 /* { dg-require-effective-target sse } */
5 #include "sse-check.h"
7 #ifdef DEBUG
8 #include <stdio.h>
9 #endif
11 #include <xmmintrin.h>
13 static void
14 __attribute__((noinline))
15 test (float *v)
17 union
19 __m128 x;
20 float f[4];
21 } u;
22 unsigned int i;
24 u.x = _mm_set_ps (v[3], v[2], v[1], v[0]);
26 for (i = 0; i < sizeof (v) / sizeof (v[0]); i++)
27 if (v[i] != u.f[i])
29 #ifdef DEBUG
30 printf ("%i: %f != %f\n", i, v[i], u.f[i]);
31 #endif
32 abort ();
36 static void
37 sse_test (void)
39 float v[4] = { -3, 2, 1, 9 };
40 test (v);