aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/mips/bswap-1.c
blob: 24016f2693135341386f2a2eec9a3d5e9c630b8a (plain)
1
2
3
4
5
6
7
8
9
10
/* { dg-options "isa_rev>=2" } */
/* { dg-skip-if "bswap recognition needs expensive optimizations" { *-*-* } { "-O0" "-O1" } { "" } } */

NOMIPS16 unsigned short
foo (unsigned short x)
{
  return ((x << 8) & 0xff00) | ((x >> 8) & 0xff);
}

/* { dg-final { scan-assembler "\twsbh\t" } } */