aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/bswap-brh.c
blob: 4dbab12891bfe6b8d568a5abe03be144cf471f9b (plain)
1
2
3
4
5
6
7
8
9
10
11
/* { dg-require-effective-target power10_ok } */
/* { dg-options "-O2 -mdejagnu-cpu=power10" } */

/* This tests whether GCC generates the ISA 3.1 16-bit byte swap
   instruction BRH.  */

unsigned short
bswap_short (unsigned short a)
{
  return __builtin_bswap16 (a); /* { dg-final { scan-assembler {\mbrh\M} } } */
}