Commit 81a55f55 by Zhenqiang Chen Committed by Zhenqiang Chen

ifcvt.c (noce_emit_cmove, [...]): Allow CC mode if HAVE_cbranchcc4.

2014-11-03  Zhenqiang Chen  <zhenqiang.chen@arm.com>

	* ifcvt.c (noce_emit_cmove, noce_get_alt_condition, noce_get_condition):
	Allow CC mode if HAVE_cbranchcc4.

From-SVN: r217026
parent afc449e8
2014-11-03 Zhenqiang Chen <zhenqiang.chen@arm.com>
* ifcvt.c (noce_emit_cmove, noce_get_alt_condition, noce_get_condition):
Allow CC mode if HAVE_cbranchcc4.
2014-11-02 Richard Sandiford <richard.sandiford@arm.com> 2014-11-02 Richard Sandiford <richard.sandiford@arm.com>
* config/arc/arc.c (write_ext_corereg_1): Delete. * config/arc/arc.c (write_ext_corereg_1): Delete.
...@@ -1448,10 +1448,17 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code, ...@@ -1448,10 +1448,17 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
end_sequence (); end_sequence ();
} }
/* Don't even try if the comparison operands are weird. */ /* Don't even try if the comparison operands are weird
except that the target supports cbranchcc4. */
if (! general_operand (cmp_a, GET_MODE (cmp_a)) if (! general_operand (cmp_a, GET_MODE (cmp_a))
|| ! general_operand (cmp_b, GET_MODE (cmp_b))) || ! general_operand (cmp_b, GET_MODE (cmp_b)))
return NULL_RTX; {
#if HAVE_cbranchcc4
if (GET_MODE_CLASS (GET_MODE (cmp_a)) != MODE_CC
|| cmp_b != const0_rtx)
#endif
return NULL_RTX;
}
#if HAVE_conditional_move #if HAVE_conditional_move
unsignedp = (code == LTU || code == GEU unsignedp = (code == LTU || code == GEU
...@@ -1777,6 +1784,11 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target, ...@@ -1777,6 +1784,11 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
rtx cond, set; rtx cond, set;
rtx_insn *insn; rtx_insn *insn;
int reverse; int reverse;
int allow_cc_mode = false;
#if HAVE_cbranchcc4
allow_cc_mode = true;
#endif
/* If target is already mentioned in the known condition, return it. */ /* If target is already mentioned in the known condition, return it. */
if (reg_mentioned_p (target, if_info->cond)) if (reg_mentioned_p (target, if_info->cond))
...@@ -1898,7 +1910,7 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target, ...@@ -1898,7 +1910,7 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
} }
cond = canonicalize_condition (if_info->jump, cond, reverse, cond = canonicalize_condition (if_info->jump, cond, reverse,
earliest, target, false, true); earliest, target, allow_cc_mode, true);
if (! cond || ! reg_mentioned_p (target, cond)) if (! cond || ! reg_mentioned_p (target, cond))
return NULL; return NULL;
...@@ -2354,6 +2366,10 @@ noce_get_condition (rtx_insn *jump, rtx_insn **earliest, bool then_else_reversed ...@@ -2354,6 +2366,10 @@ noce_get_condition (rtx_insn *jump, rtx_insn **earliest, bool then_else_reversed
{ {
rtx cond, set, tmp; rtx cond, set, tmp;
bool reverse; bool reverse;
int allow_cc_mode = false;
#if HAVE_cbranchcc4
allow_cc_mode = true;
#endif
if (! any_condjump_p (jump)) if (! any_condjump_p (jump))
return NULL_RTX; return NULL_RTX;
...@@ -2390,7 +2406,7 @@ noce_get_condition (rtx_insn *jump, rtx_insn **earliest, bool then_else_reversed ...@@ -2390,7 +2406,7 @@ noce_get_condition (rtx_insn *jump, rtx_insn **earliest, bool then_else_reversed
/* Otherwise, fall back on canonicalize_condition to do the dirty /* Otherwise, fall back on canonicalize_condition to do the dirty
work of manipulating MODE_CC values and COMPARE rtx codes. */ work of manipulating MODE_CC values and COMPARE rtx codes. */
tmp = canonicalize_condition (jump, cond, reverse, earliest, tmp = canonicalize_condition (jump, cond, reverse, earliest,
NULL_RTX, false, true); NULL_RTX, allow_cc_mode, true);
/* We don't handle side-effects in the condition, like handling /* We don't handle side-effects in the condition, like handling
REG_INC notes and making sure no duplicate conditions are emitted. */ REG_INC notes and making sure no duplicate conditions are emitted. */
......
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