diff options
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-5.c')
-rw-r--r-- | gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-5.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-5.c b/gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-5.c new file mode 100644 index 000000000..45520e4ab --- /dev/null +++ b/gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-5.c @@ -0,0 +1,20 @@ +/* { dg-options "isa_rev>=2 -mgp64" } */ +/* { dg-skip-if "bswap recognition needs expensive optimizations" { *-*-* } { "-O0" "-O1" } { "" } } */ + +typedef unsigned long long uint64_t; + +NOMIPS16 uint64_t +foo (uint64_t x) +{ + return (((x << 56) & 0xff00000000000000ull) + | ((x << 40) & 0xff000000000000ull) + | ((x << 24) & 0xff0000000000ull) + | ((x << 8) & 0xff00000000ull) + | ((x >> 8) & 0xff000000) + | ((x >> 24) & 0xff0000) + | ((x >> 40) & 0xff00) + | ((x >> 56) & 0xff)); +} + +/* { dg-final { scan-assembler "\tdsbh\t" } } */ +/* { dg-final { scan-assembler "\tdshd\t" } } */ |