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

NOMIPS16 unsigned int
foo (unsigned int x)
{
  return (((x << 24) & 0xff000000)
	  | ((x << 8) & 0xff0000)
	  | ((x >> 8) & 0xff00)
	  | ((x >> 24) & 0xff));
}

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