Commit 85bd4ac6 by Kyrylo Tkachov Committed by Kyrylo Tkachov

combine.c (simplify_comparison): Re-canonicalize operands where appropriate.

2013-07-26  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
            Richard Earnshaw  <richard.earnshaw@arm.com>

	* combine.c (simplify_comparison): Re-canonicalize operands
	where appropriate.	
	* config/arm/arm.md (movcond_addsi): New splitter.

Co-Authored-By: Richard Earnshaw <rearnsha@arm.com>

From-SVN: r201260
parent 62038e61
2013-07-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Richard Earnshaw <richard.earnshaw@arm.com>
* combine.c (simplify_comparison): Re-canonicalize operands
where appropriate.
* config/arm/arm.md (movcond_addsi): New splitter.
2013-07-25 Sterling Augustine <saugustine@google.com> 2013-07-25 Sterling Augustine <saugustine@google.com>
* dwarf2out.c (size_of_pubnames): Move code to... * dwarf2out.c (size_of_pubnames): Move code to...
......
...@@ -11990,6 +11990,13 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) ...@@ -11990,6 +11990,13 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
} }
} }
/* We may have changed the comparison operands. Re-canonicalize. */
if (swap_commutative_operands_p (op0, op1))
{
tem = op0, op0 = op1, op1 = tem;
code = swap_condition (code);
}
/* If this machine only supports a subset of valid comparisons, see if we /* If this machine only supports a subset of valid comparisons, see if we
can convert an unsupported one into a supported one. */ can convert an unsupported one into a supported one. */
target_canonicalize_comparison (&code, &op0, &op1, 0); target_canonicalize_comparison (&code, &op0, &op1, 0);
......
...@@ -11112,6 +11112,44 @@ ...@@ -11112,6 +11112,44 @@
(set_attr "length" "12")] (set_attr "length" "12")]
) )
(define_insn_and_split "movcond_addsi"
[(set (match_operand:SI 0 "s_register_operand" "=r,l,r")
(if_then_else:SI
(match_operator 5 "comparison_operator"
[(plus:SI (match_operand:SI 3 "s_register_operand" "r,r,r")
(match_operand:SI 4 "arm_add_operand" "rIL,rIL,rIL"))
(const_int 0)])
(match_operand:SI 1 "arm_rhs_operand" "rI,rPy,r")
(match_operand:SI 2 "arm_rhs_operand" "rI,rPy,r")))
(clobber (reg:CC CC_REGNUM))]
"TARGET_32BIT"
"#"
"&& reload_completed"
[(set (reg:CC_NOOV CC_REGNUM)
(compare:CC_NOOV
(plus:SI (match_dup 3)
(match_dup 4))
(const_int 0)))
(set (match_dup 0) (match_dup 1))
(cond_exec (match_dup 6)
(set (match_dup 0) (match_dup 2)))]
"
{
enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[5]),
operands[3], operands[4]);
enum rtx_code rc = GET_CODE (operands[5]);
operands[6] = gen_rtx_REG (mode, CC_REGNUM);
gcc_assert (!(mode == CCFPmode || mode == CCFPEmode));
rc = reverse_condition (rc);
operands[6] = gen_rtx_fmt_ee (rc, VOIDmode, operands[6], const0_rtx);
}
"
[(set_attr "conds" "clob")
(set_attr "enabled_for_depr_it" "no,yes,yes")]
)
(define_insn "movcond" (define_insn "movcond"
[(set (match_operand:SI 0 "s_register_operand" "=r,r,r") [(set (match_operand:SI 0 "s_register_operand" "=r,r,r")
(if_then_else:SI (if_then_else:SI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment