Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse-3.c
blob338b7c60ba75bae8dd03edd12363acd918626ace
1 /* PR target/21149 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -msse" } */
5 #include "sse-check.h"
7 #include <xmmintrin.h>
9 void
10 __attribute__((noinline))
11 check (__m128 x, float a, float b, float c, float d)
13 union { __m128 m; float f[4]; } u;
14 u.m = x;
15 if (u.f[0] != a || u.f[1] != b || u.f[2] != c || u.f[3] != d)
16 abort ();
19 static inline
20 void
21 foo (__m128 *x)
23 __m128 y = _mm_setzero_ps ();
24 __m128 v = _mm_movehl_ps (y, *x);
25 __m128 w = _mm_movehl_ps (*x, y);
26 check (*x, 9, 1, 2, -3);
27 check (v, 2, -3, 0, 0);
28 check (w, 0, 0, 2, -3);
31 static void
32 sse_test (void)
34 __m128 y = _mm_set_ps (-3, 2, 1, 9);
35 foo (&y);