diff options
author | clyon <clyon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-26 13:42:47 +0000 |
---|---|---|
committer | clyon <clyon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-26 13:42:47 +0000 |
commit | f811051bf87b1de7804c19c8192d0d099d157145 (patch) | |
tree | 5de5ececa60b97c5b81f927d45e3dbbf008c91e5 /gcc/testsuite/gcc.target/arm | |
parent | 567510a28cdfeea8e43b8e5d6b72da1abe10c7c3 (diff) | |
download | gcc-f811051bf87b1de7804c19c8192d0d099d157145.tar.gz |
2012-09-26 Christophe Lyon <christophe.lyon@linaro.org>
gcc/
* tree-ssa-math-opts.c (bswap_stats): Add found_16bit field.
(execute_optimize_bswap): Add support for builtin_bswap16.
gcc/testsuite/
* gcc.target/arm/builtin-bswap16-1.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/arm')
-rw-r--r-- | gcc/testsuite/gcc.target/arm/builtin-bswap16-1.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/builtin-bswap16-1.c b/gcc/testsuite/gcc.target/arm/builtin-bswap16-1.c new file mode 100644 index 00000000000..6920f004eab --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/builtin-bswap16-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ +/* { dg-add-options arm_arch_v6 } */ +/* { dg-final { scan-assembler-not "orr\[ \t\]" } } */ + +unsigned short swapu16_1 (unsigned short x) +{ + return (x << 8) | (x >> 8); +} + +unsigned short swapu16_2 (unsigned short x) +{ + return (x >> 8) | (x << 8); +} |