[RS6000] Tests that use int128_t and -m32
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-addsd-1.c
blob634746a2a97df1c37d7deaa5a03823a8235f8e13
1 /* { dg-do run } */
2 /* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
3 /* { dg-require-effective-target p8vector_hw } */
6 #include <stdint.h>
7 #include <stdio.h>
9 #ifndef CHECK_H
10 #define CHECK_H "sse2-check.h"
11 #endif
13 #include CHECK_H
15 #ifndef TEST
16 #define TEST sse2_test_addsd_1
17 #endif
19 #include <emmintrin.h>
21 static __m128d
22 __attribute__((noinline, unused))
23 test (__m128d s1, __m128d s2)
25 __asm("" : "+v"(s1), "+v"(s2));
26 return _mm_add_sd (s1, s2);
29 static void
30 TEST (void)
32 union128d u, s1, s2;
33 double e[2];
35 s1.x = _mm_set_pd (2134.3343,1234.635654);
36 s2.x = _mm_set_pd (41124.234,2344.2354);
37 u.x = test (s1.x, s2.x);
39 e[0] = s1.a[0] + s2.a[0];
40 e[1] = s1.a[1];
42 if (check_union128d (u, e))
44 #if DEBUG
45 printf ("sse2_test_addsd_1; check_union128d failed\n");
46 printf ("\t [%f,%f] + [%f,%f] -> [%f,%f]\n", s1.a[0], s1.a[1], s2.a[0],
47 s2.a[1], u.a[0], u.a[1]);
48 printf ("\t expect [%f,%f]\n", e[0], e[1]);
49 #endif
50 abort ();