summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-08 15:03:21 +0000
committerolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-08 15:03:21 +0000
commitdc1be6dde0a6dcb8e8b143a34f6ec0866aa25b69 (patch)
tree67340f5b3ebf5f912483544d822439f9488b3298
parent4a020a8c3dfec7d26c2e1f9c55286390c5fad76d (diff)
downloadgcc-dc1be6dde0a6dcb8e8b143a34f6ec0866aa25b69.tar.gz
PR target/51244
* config/sh/sh.md (*branch_true_eq, *branch_false_ne, nott): New insns. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189360 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.md36
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f0f0bfaa3c2..4e401479587 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-08 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/51244
+ * config/sh/sh.md (*branch_true_eq, *branch_false_ne, nott): New insns.
+
2012-07-08 Steven Bosscher <steven@gcc.gnu.org>
* basic-block.h: Re-group most prototypes per file.
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 980aa6f30b1..cf37cb9179d 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -7220,6 +7220,17 @@ label:
}
[(set_attr "type" "cbranch")])
+(define_insn "*branch_true_eq"
+ [(set (pc) (if_then_else (eq (match_operand 1 "t_reg_operand" "")
+ (const_int 1))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ "TARGET_SH1"
+{
+ return output_branch (1, insn, operands);
+}
+ [(set_attr "type" "cbranch")])
+
(define_insn "branch_false"
[(set (pc) (if_then_else (eq (match_operand 1 "t_reg_operand" "")
(const_int 0))
@@ -7231,6 +7242,17 @@ label:
}
[(set_attr "type" "cbranch")])
+(define_insn "*branch_false_ne"
+ [(set (pc) (if_then_else (ne (match_operand 1 "t_reg_operand" "")
+ (const_int 1))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ "TARGET_SH1"
+{
+ return output_branch (0, insn, operands);
+}
+ [(set_attr "type" "cbranch")])
+
;; Patterns to prevent reorg from re-combining a condbranch with a branch
;; which destination is too far away.
;; The const_int_operand is distinct for each branch target; it avoids
@@ -9844,6 +9866,20 @@ label:
""
[(const_int 0)])
+(define_insn_and_split "nott"
+ [(set (reg:SI T_REG) (xor:SI (reg:SI T_REG) (const_int 1)))]
+ "TARGET_SH1"
+{
+ gcc_assert (TARGET_SH2A);
+ return "nott";
+}
+ "! TARGET_SH2A && can_create_pseudo_p ()"
+ [(set (match_dup 0) (reg:SI T_REG))
+ (set (reg:SI T_REG) (eq:SI (match_dup 0) (const_int 0)))]
+{
+ operands[0] = gen_reg_rtx (SImode);
+})
+
(define_expand "cstoresf4"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operator:SI 1 "sh_float_comparison_operator"