[RS6000] Tests that use int128_t and -m32
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-pmuludq-1.c
blob1e41d464b14c40b81f4c86a6ba32afc130181ee0
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_pmuludq_1
13 #endif
15 #include <emmintrin.h>
17 static __m128i
18 __attribute__((noinline, unused))
19 test (__m128i s1, __m128i s2)
21 __asm("" : "+v"(s1), "+v"(s2));
22 return _mm_mul_epu32 (s1, s2);
25 static void
26 TEST (void)
28 union128i_d s1, s2;
29 union128i_q u;
30 long long e[2];
32 s1.x = _mm_set_epi32 (10,2067,3033,905);
33 s2.x = _mm_set_epi32 (11, 9834, 7444, 10222);
34 __asm("" : "+v"(s1.x), "+v"(s2.x));
35 u.x = test (s1.x, s2.x);
37 e[0] = s1.a[0] * s2.a[0];
38 e[1] = s1.a[2] * s2.a[2];
40 if (check_union128i_q (u, e))
42 #if DEBUG
43 printf ("sse2_test_pmuludq_1; check_union128i_q failed\n");
44 printf ("\t ([%x,%x,%x,%x], [%x,%x,%x,%x], -> [%llx, %llx])\n", s1.a[0],
45 s1.a[1], s1.a[2], s1.a[3], s2.a[0], s2.a[1], s2.a[2], s2.a[3],
46 u.a[0], u.a[1]);
47 printf ("\t expect [%llx, %llx]\n", e[0], e[1]);
48 #endif
49 abort ();