gcc/
[official-gcc.git] / gcc / testsuite / gcc.target / mips / bswap-5.c
blob45520e4ab850b4033b150b297b3406c13fe750fd
1 /* { dg-options "isa_rev>=2 -mgp64" } */
2 /* { dg-skip-if "bswap recognition needs expensive optimizations" { *-*-* } { "-O0" "-O1" } { "" } } */
4 typedef unsigned long long uint64_t;
6 NOMIPS16 uint64_t
7 foo (uint64_t x)
9 return (((x << 56) & 0xff00000000000000ull)
10 | ((x << 40) & 0xff000000000000ull)
11 | ((x << 24) & 0xff0000000000ull)
12 | ((x << 8) & 0xff00000000ull)
13 | ((x >> 8) & 0xff000000)
14 | ((x >> 24) & 0xff0000)
15 | ((x >> 40) & 0xff00)
16 | ((x >> 56) & 0xff));
19 /* { dg-final { scan-assembler "\tdsbh\t" } } */
20 /* { dg-final { scan-assembler "\tdshd\t" } } */