[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-cvttsd2si-2.c
blob4331f83766380c41fc0318063ebe82eb7a7cb0b4
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_cvttsd2si_2
14 #endif
16 #include <emmintrin.h>
18 static long long
19 __attribute__((noinline, unused))
20 test (__m128d p)
22 __asm("" : "+v"(p));
23 return _mm_cvttsd_si64 (p);
26 static void
27 TEST (void)
29 union128d s;
30 long long e;
31 long long d;
33 s.x = _mm_set_pd (123.321, 42949672339501.4);
35 d = test (s.x);
36 e = (long long)(s.a[0]);
38 if (d != e)
39 abort ();