aboutsummaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorZhenqiang Chen <zhenqiang.chen@arm.com>2014-11-17 06:29:07 +0000
committerZhenqiang Chen <zqchen@gcc.gnu.org>2014-11-17 06:29:07 +0000
commit4696acf0d351041af6c75cf6a33703c0acdbdc76 (patch)
treeb2395bb473ccd137806864ffd07515289c968e31 /gcc/ifcvt.c
parent7dd236702d11b60084560f56b0c3ffdd197c885a (diff)
downloadgcc-4696acf0d351041af6c75cf6a33703c0acdbdc76.zip
gcc-4696acf0d351041af6c75cf6a33703c0acdbdc76.tar.gz
gcc-4696acf0d351041af6c75cf6a33703c0acdbdc76.tar.bz2
ifcvt.c (HAVE_cbranchcc4): Define.
2014-11-17 Zhenqiang Chen <zhenqiang.chen@arm.com> * ifcvt.c (HAVE_cbranchcc4): Define. (noce_emit_cmove, noce_get_alt_condition, noce_get_condition): Use HAVE_cbranchcc4. From-SVN: r217646
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index f4002f9..21f08c2 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -75,6 +75,10 @@
+ 1)
#endif
+#ifndef HAVE_cbranchcc4
+#define HAVE_cbranchcc4 0
+#endif
+
#define IFCVT_MULTIPLE_DUMPS 1
#define NULL_BLOCK ((basic_block) NULL)
@@ -1459,10 +1463,16 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
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))
|| ! general_operand (cmp_b, GET_MODE (cmp_b)))
- return NULL_RTX;
+ {
+ if (!(HAVE_cbranchcc4)
+ || GET_MODE_CLASS (GET_MODE (cmp_a)) != MODE_CC
+ || cmp_b != const0_rtx)
+ return NULL_RTX;
+ }
#if HAVE_conditional_move
unsignedp = (code == LTU || code == GEU
@@ -1909,7 +1919,7 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
}
cond = canonicalize_condition (if_info->jump, cond, reverse,
- earliest, target, false, true);
+ earliest, target, HAVE_cbranchcc4, true);
if (! cond || ! reg_mentioned_p (target, cond))
return NULL;
@@ -2401,7 +2411,7 @@ noce_get_condition (rtx_insn *jump, rtx_insn **earliest, bool then_else_reversed
/* Otherwise, fall back on canonicalize_condition to do the dirty
work of manipulating MODE_CC values and COMPARE rtx codes. */
tmp = canonicalize_condition (jump, cond, reverse, earliest,
- NULL_RTX, false, true);
+ NULL_RTX, HAVE_cbranchcc4, true);
/* We don't handle side-effects in the condition, like handling
REG_INC notes and making sure no duplicate conditions are emitted. */