gcc/
[official-gcc.git] / gcc / testsuite / gcc.target / mips / bswap-3.c
blob5d2086fd32481c6bd3b1f3b86128b1ef01739298
1 /* { dg-options "isa_rev>=2" } */
2 /* { dg-skip-if "bswap recognition needs expensive optimizations" { *-*-* } { "-O0" "-O1" } { "" } } */
4 NOMIPS16 unsigned int
5 foo (unsigned int x)
7 return (((x << 24) & 0xff000000)
8 | ((x << 8) & 0xff0000)
9 | ((x >> 8) & 0xff00)
10 | ((x >> 24) & 0xff));
13 /* { dg-final { scan-assembler "\twsbh\t" } } */
14 /* { dg-final { scan-assembler "\tror\t" } } */