summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-14 02:59:42 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-14 02:59:42 +0000
commitc071a2dff4d3e938f05021e7568bfae44bde944c (patch)
treead6d3c452b2626d6643772b84fef9585f0dd5c22 /gcc
parentdeed199ccb73d698fbed555ba5d094e5ce19e582 (diff)
downloadgcc-c071a2dff4d3e938f05021e7568bfae44bde944c.tar.gz
* optabs.c (expand_abs): Don't call do_jump_by_parts_greater_rtx
directly, instead let do_compare_rtx_and_jump handle this for us. * expr.c (expand_expr_real_1): Likewise. * dojump.c (do_jump_by_parts_greater_rtx): Make static. Move before do_jump_by_parts_greater. (do_jump_by_parts_greater): Move after do_jump_by_parts_greater_rtx. * expr.h (do_jump_by_parts_greater_rtx): Delete prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110954 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/dojump.c38
-rw-r--r--gcc/expr.c20
-rw-r--r--gcc/expr.h3
-rw-r--r--gcc/optabs.c11
5 files changed, 33 insertions, 49 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 53af55e3abd..6ffd3321150 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2006-02-13 Roger Sayle <roger@eyesopen.com>
+
+ * optabs.c (expand_abs): Don't call do_jump_by_parts_greater_rtx
+ directly, instead let do_compare_rtx_and_jump handle this for us.
+ * expr.c (expand_expr_real_1): Likewise.
+ * dojump.c (do_jump_by_parts_greater_rtx): Make static. Move
+ before do_jump_by_parts_greater.
+ (do_jump_by_parts_greater): Move after do_jump_by_parts_greater_rtx.
+ * expr.h (do_jump_by_parts_greater_rtx): Delete prototype.
+
2006-02-13 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa/quadlib.c: Use defines instead of enum qfcmp_magic.
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 86dc6f4a6c4..da162d67680 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -609,29 +609,11 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
}
}
-/* Given a comparison expression EXP for values too wide to be compared
- with one insn, test the comparison and jump to the appropriate label.
- The code of EXP is ignored; we always test GT if SWAP is 0,
- and LT if SWAP is 1. */
-
-static void
-do_jump_by_parts_greater (tree exp, int swap, rtx if_false_label,
- rtx if_true_label)
-{
- rtx op0 = expand_normal (TREE_OPERAND (exp, swap));
- rtx op1 = expand_normal (TREE_OPERAND (exp, !swap));
- enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- int unsignedp = TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)));
-
- do_jump_by_parts_greater_rtx (mode, unsignedp, op0, op1, if_false_label,
- if_true_label);
-}
-
/* Compare OP0 with OP1, word at a time, in mode MODE.
UNSIGNEDP says to do unsigned comparison.
Jump to IF_TRUE_LABEL if OP0 is greater, IF_FALSE_LABEL otherwise. */
-void
+static void
do_jump_by_parts_greater_rtx (enum machine_mode mode, int unsignedp, rtx op0,
rtx op1, rtx if_false_label, rtx if_true_label)
{
@@ -677,6 +659,24 @@ do_jump_by_parts_greater_rtx (enum machine_mode mode, int unsignedp, rtx op0,
if (drop_through_label)
emit_label (drop_through_label);
}
+
+/* Given a comparison expression EXP for values too wide to be compared
+ with one insn, test the comparison and jump to the appropriate label.
+ The code of EXP is ignored; we always test GT if SWAP is 0,
+ and LT if SWAP is 1. */
+
+static void
+do_jump_by_parts_greater (tree exp, int swap, rtx if_false_label,
+ rtx if_true_label)
+{
+ rtx op0 = expand_normal (TREE_OPERAND (exp, swap));
+ rtx op1 = expand_normal (TREE_OPERAND (exp, !swap));
+ enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
+ int unsignedp = TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)));
+
+ do_jump_by_parts_greater_rtx (mode, unsignedp, op0, op1, if_false_label,
+ if_true_label);
+}
/* Jump according to whether OP0 is 0. We assume that OP0 has an integer
mode, MODE, that is too wide for the available compare insns. Either
diff --git a/gcc/expr.c b/gcc/expr.c
index 537ce1ef83e..92d8d280758 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8184,24 +8184,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
emit_move_insn (target, op0);
temp = gen_label_rtx ();
-
- /* If this mode is an integer too wide to compare properly,
- compare word by word. Rely on cse to optimize constant cases. */
- if (GET_MODE_CLASS (mode) == MODE_INT
- && ! can_compare_p (GE, mode, ccp_jump))
- {
- if (code == MAX_EXPR)
- do_jump_by_parts_greater_rtx (mode, unsignedp, target, op1,
- NULL_RTX, temp);
- else
- do_jump_by_parts_greater_rtx (mode, unsignedp, op1, target,
- NULL_RTX, temp);
- }
- else
- {
- do_compare_rtx_and_jump (target, cmpop1, comparison_code,
- unsignedp, mode, NULL_RTX, NULL_RTX, temp);
- }
+ do_compare_rtx_and_jump (target, cmpop1, comparison_code,
+ unsignedp, mode, NULL_RTX, NULL_RTX, temp);
}
emit_move_insn (target, op1);
emit_label (temp);
diff --git a/gcc/expr.h b/gcc/expr.h
index f1cf081b195..d52d57a9741 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -743,9 +743,6 @@ extern void init_all_optabs (void);
/* Call this to initialize an optab function entry. */
extern rtx init_one_libfunc (const char *);
-extern void do_jump_by_parts_greater_rtx (enum machine_mode, int, rtx, rtx,
- rtx, rtx);
-
extern int vector_mode_valid_p (enum machine_mode);
#endif /* GCC_EXPR_H */
diff --git a/gcc/optabs.c b/gcc/optabs.c
index bdbb88cce33..0ab8406d3ec 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -2898,15 +2898,8 @@ expand_abs (enum machine_mode mode, rtx op0, rtx target,
emit_move_insn (target, op0);
NO_DEFER_POP;
- /* If this mode is an integer too wide to compare properly,
- compare word by word. Rely on CSE to optimize constant cases. */
- if (GET_MODE_CLASS (mode) == MODE_INT
- && ! can_compare_p (GE, mode, ccp_jump))
- do_jump_by_parts_greater_rtx (mode, 0, target, const0_rtx,
- NULL_RTX, op1);
- else
- do_compare_rtx_and_jump (target, CONST0_RTX (mode), GE, 0, mode,
- NULL_RTX, NULL_RTX, op1);
+ do_compare_rtx_and_jump (target, CONST0_RTX (mode), GE, 0, mode,
+ NULL_RTX, NULL_RTX, op1);
op0 = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
target, target, 0);