[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / swaps-p8-46.c
blob3b5154b12312af0f0fc453fce9a9acb2098801f2
1 /* { dg-do run { target le } } */
2 /* { dg-require-effective-target powerpc_vsx_ok } */
3 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2 " } */
5 typedef __attribute__ ((__aligned__ (8))) unsigned long long __m64;
6 typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
8 /* PR84033. Extracted from xmmintrin.h but with a pointer param to
9 allow swaps to happen when not inline. */
10 int __attribute__ ((__noinline__))
11 _mm_movemask_ps (__m128 *__A)
13 __vector __m64 result;
14 static const __vector unsigned int perm_mask =
16 0x00204060, 0x80808080, 0x80808080, 0x80808080
19 result = (__vector __m64)
20 __builtin_vec_vbpermq ((__vector unsigned char) (*__A),
21 (__vector unsigned char) perm_mask);
22 return result[1];
25 int
26 main (void)
28 union { unsigned int i[4]; __m128 m; } x
29 = { 0x80000000, 0x80000000, 0x7fffffff, 0x7fffffff };
30 if (_mm_movemask_ps (&x.m) != 3)
31 __builtin_abort ();
32 return 0;