[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / bswap-brw.c
blob0ed2a7bd1d25949ed75de6d45e210b83e1a73a69
1 /* { dg-require-effective-target power10_ok } */
2 /* { dg-options "-O2 -mdejagnu-cpu=power10" } */
4 /* This tests whether GCC generates the ISA 3.1 BRW byte swap instruction for
5 GPR data, but generates XXBRW for data in a vector register. */
7 unsigned int
8 bswap_int (unsigned int a)
10 return __builtin_bswap32 (a); /* { dg-final { scan-assembler {\mbrw\M} } } */
13 double
14 bswap_int_dbl (unsigned int a)
16 unsigned int b = a;
17 /* Force the value to be loaded into a vector register. */
18 __asm__ (" # %x0" : "+wa" (b));
20 /* { dg-final { scan-assembler {\mxxbrw\M} {xfail {has_arch_pwr10 && {! has_arch_ppc64}}} } } */
21 return (double) __builtin_bswap32 (b);