[RS6000] Tests that use int128_t and -m32
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-cvtsd2si-2.c
blob00387a7a25b37e2664d9b2c06225717cd38c1225
1 /* { dg-do run } */
2 /* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
3 /* { dg-require-effective-target p8vector_hw } */
5 #ifndef CHECK_H
6 #define CHECK_H "sse2-check.h"
7 #endif
9 #include CHECK_H
11 #ifndef TEST
12 #define TEST sse2_test_cvtsd2si_2
13 #endif
15 #include <emmintrin.h>
17 static long long
18 __attribute__((noinline, unused))
19 test (__m128d p)
21 return _mm_cvtsd_si64 (p);
24 static void
25 TEST (void)
27 union128d s;
28 long long e;
29 long long d;
31 s.x = _mm_set_pd (829496729501.4, 429496729501.4);
33 d = test (s.x);
35 e = (long long)(s.a[0] + 0.5);
37 if (d != e)
39 #if DEBUG
40 printf ("sse2_test_cvtsd2si_2; failed\n");
41 printf ("\t [%f,%f] -> [%ld]\n", s.a[0], s.a[1], d);
42 printf ("\t expect [%ld]\n", e);
43 #endif
44 abort ();