[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p9-xxbr-2.c
blob7e89daafe5c377813626bffe888ae0de61ecddc3
1 /* { dg-do compile { target lp64 } } */
2 /* { dg-require-effective-target powerpc_vsx_ok } */
3 /* { dg-options "-mdejagnu-cpu=power9 -mvsx -O2" } */
5 #include <altivec.h>
7 /* Verify P9 vec_revb builtin generates the XXBR{Q,D,W,H} instructions. This
8 test only tests the vector types that need a 64-bit environment. */
10 vector long
11 rev_long (vector long a)
13 return vec_revb (a); /* XXBRD. */
16 vector unsigned long
17 rev_ulong (vector unsigned long a)
19 return vec_revb (a); /* XXBRD. */
22 vector long long
23 rev_long_long (vector long long a)
25 return vec_revb (a); /* XXBRD. */
28 vector bool long long
29 rev_bool_long_long (vector bool long long a)
31 return vec_revb (a); /* XXBRD. */
34 vector unsigned long long
35 rev_ulong_ulong (vector unsigned long long a)
37 return vec_revb (a); /* XXBRD. */
40 vector __int128_t
41 rev_int128 (vector __int128_t a)
43 return vec_revb (a); /* XXBRQ. */
46 vector __uint128_t
47 rev_uint128 (vector __uint128_t a)
49 return vec_revb (a); /* XXBRQ. */
52 /* { dg-final { scan-assembler-times "xxbrd" 5 } } */
53 /* { dg-final { scan-assembler-times "xxbrq" 2 } } */