PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse2-cvtss2sd-1.c
blobeda870d4fd9d70e03942db8f5a76c7cdea67c13b
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse2" } */
3 /* { dg-require-effective-target sse2 } */
5 #ifndef CHECK_H
6 #define CHECK_H "sse2-check.h"
7 #endif
9 #ifndef TEST
10 #define TEST sse2_test
11 #endif
13 #include CHECK_H
15 #include <emmintrin.h>
17 static __m128d
18 __attribute__((noinline, unused))
19 test (__m128d a, __m128 b)
21 return _mm_cvtss_sd (a, b);
24 static void
25 TEST (void)
27 union128d u, s1;
28 union128 s2;
29 double e[2];
31 s1.x = _mm_set_pd (123.321, 456.987);
32 s2.x = _mm_set_ps (123.321, 456.987, 666.45, 231.987);
34 u.x = test (s1.x, s2.x);
36 e[0] = (double)s2.a[0];
37 e[1] = s1.a[1];
39 if (check_union128d (u, e))
40 abort ();