[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-pmuludq-1.c
blob883f1bb6cde097371317079af56ce9cbc820ee52
1 /* { dg-do run } */
2 /* { dg-options "-O3 -mvsx -Wno-psabi" } */
3 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
4 /* { dg-require-effective-target p8vector_hw } */
6 #ifndef CHECK_H
7 #define CHECK_H "sse2-check.h"
8 #endif
10 #include CHECK_H
12 #ifndef TEST
13 #define TEST sse2_test_pmuludq_1
14 #endif
16 #include <emmintrin.h>
18 static __m128i
19 __attribute__((noinline, unused))
20 test (__m128i s1, __m128i s2)
22 __asm("" : "+v"(s1), "+v"(s2));
23 return _mm_mul_epu32 (s1, s2);
26 static void
27 TEST (void)
29 union128i_d s1, s2;
30 union128i_q u;
31 long long e[2];
33 s1.x = _mm_set_epi32 (10,2067,3033,905);
34 s2.x = _mm_set_epi32 (11, 9834, 7444, 10222);
35 __asm("" : "+v"(s1.x), "+v"(s2.x));
36 u.x = test (s1.x, s2.x);
38 e[0] = s1.a[0] * s2.a[0];
39 e[1] = s1.a[2] * s2.a[2];
41 if (check_union128i_q (u, e))
43 #if DEBUG
44 printf ("sse2_test_pmuludq_1; check_union128i_q failed\n");
45 printf ("\t ([%x,%x,%x,%x], [%x,%x,%x,%x], -> [%llx, %llx])\n", s1.a[0],
46 s1.a[1], s1.a[2], s1.a[3], s2.a[0], s2.a[1], s2.a[2], s2.a[3],
47 u.a[0], u.a[1]);
48 printf ("\t expect [%llx, %llx]\n", e[0], e[1]);
49 #endif
50 abort ();