aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2016-05-06 09:41:57 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2016-05-06 09:41:57 +0000
commit3684b02efb8df49a5795034657353d875333c86e (patch)
tree3d5c16253a3fbd64fcd21d3242460c274bdeba55 /gcc
parent498988ad6a960bf75caa9c88bbeb0b981f2d0dc9 (diff)
downloadgcc-3684b02efb8df49a5795034657353d875333c86e.zip
gcc-3684b02efb8df49a5795034657353d875333c86e.tar.gz
gcc-3684b02efb8df49a5795034657353d875333c86e.tar.bz2
re PR target/54089 ([SH] Refactor shift patterns)
gcc/ PR target/54089 * config/sh/sh.md (*rotcr): Add another variant. gcc/testsuite/ PR target/54089 * gcc.target/sh/pr54089-1.c (test_24): Add new sub-test. From-SVN: r235950
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.md16
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/sh/pr54089-1.c9
4 files changed, 34 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3bf441a..951ae2c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-06 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/54089
+ * config/sh/sh.md (*rotcr): Add another variant.
+
2016-05-06 Richard Biener <rguenther@suse.de>
PR middle-end/70931
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 2a8fbc8..0ab76b5 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -3359,6 +3359,22 @@
DONE;
})
+(define_insn_and_split "*rotcr"
+ [(set (match_operand:SI 0 "arith_reg_dest")
+ (ior:SI (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand")
+ (const_int 1))
+ (const_int -2147483648))) ;; 0xffffffff80000000
+ (clobber (reg:SI T_REG))]
+ "TARGET_SH1"
+ "#"
+ "&& can_create_pseudo_p ()"
+ [(const_int 0)]
+{
+ emit_insn (gen_sett ());
+ emit_insn (gen_rotcr (operands[0], operands[1], get_t_reg_rtx ()));
+ DONE;
+})
+
;; rotcr combine patterns for rotating in the negated T_REG value.
(define_insn_and_split "*rotcr_neg_t"
[(set (match_operand:SI 0 "arith_reg_dest")
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 13f7121..17773ce 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-06 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/54089
+ * gcc.target/sh/pr54089-1.c (test_24): Add new sub-test.
+
2016-05-06 Richard Biener <rguenther@suse.de>
PR middle-end/70931
diff --git a/gcc/testsuite/gcc.target/sh/pr54089-1.c b/gcc/testsuite/gcc.target/sh/pr54089-1.c
index 64f79eb..8b6a729 100644
--- a/gcc/testsuite/gcc.target/sh/pr54089-1.c
+++ b/gcc/testsuite/gcc.target/sh/pr54089-1.c
@@ -1,7 +1,8 @@
/* Check that the rotcr instruction is generated. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-final { scan-assembler-times "rotcr" 24 } } */
+/* { dg-final { scan-assembler-times "rotcr" 25 } } */
+/* { dg-final { scan-assembler-times "sett" 1 } } */
/* { dg-final { scan-assembler-times "shll\t" 1 } } */
/* { dg-final { scan-assembler-not "and\t#1" } } */
/* { dg-final { scan-assembler-not "cmp/pl" } } */
@@ -173,3 +174,9 @@ test_23 (unsigned int a, int b, int c)
bool r = b != c;
return ((a >> 31) | (r << 31));
}
+
+unsigned int
+test_24 (unsigned int a)
+{
+ return (a >> 1) | (1 << 31);
+}