aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2012-07-30 06:46:36 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2012-07-30 06:46:36 +0000
commitbe8cbce15811f4d5ba02d7f3d8784b7b94b421d1 (patch)
tree9cea2b0f80a42a70613848e3f11ac4a857ab77d4 /gcc/testsuite
parentbe82afe609f07d51a1d57fecbd1daf1882528f4c (diff)
downloadgcc-be8cbce15811f4d5ba02d7f3d8784b7b94b421d1.zip
gcc-be8cbce15811f4d5ba02d7f3d8784b7b94b421d1.tar.gz
gcc-be8cbce15811f4d5ba02d7f3d8784b7b94b421d1.tar.bz2
re PR target/51244 ([SH] Inefficient conditional branch and code around T bit)
PR target/51244 * config/sh/sh.md (mov_neg_si_t): Move to Scc instructions section. Use t_reg_operand predicate. Add split for negated case. (ashrsi2_31): Pass get_t_reg_rtx to gen_mov_neg_si_t. * config/sh/sh.c (expand_ashiftrt): Likewise. PR target/51244 * gcc.target/sh/pr51244-4.c: New. From-SVN: r189953
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/sh/pr51244-4.c19
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c318d45..74af965 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-30 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/51244
+ * gcc.target/sh/pr51244-4.c: New.
+
2012-07-27 Uros Bizjak <ubizjak@gmail.com>
* gfortran.dg/bind_c_array_params_2.f90: Add "-mno-explicit-relocs"
diff --git a/gcc/testsuite/gcc.target/sh/pr51244-4.c b/gcc/testsuite/gcc.target/sh/pr51244-4.c
new file mode 100644
index 0000000..f307378
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pr51244-4.c
@@ -0,0 +1,19 @@
+/* Check that storing the (negated) T bit as all ones or zeros in a reg
+ uses the subc instruction. On SH2A a sequence with the movrt instruction
+ is also OK instead of subc. */
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-options "-O1 -mbranch-cost=2" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */
+/* { dg-final { scan-assembler-not "movt|tst|negc" } } */
+/* { dg-final { scan-assembler "subc|movrt|neg|not" } } */
+
+int test_00 (int x, int y)
+{
+ return x != y ? -1 : 0;
+}
+
+int test_01 (int x, int y)
+{
+ return x == y ? -1 : 0;
+}
+