aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-02-14 02:59:42 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-02-14 02:59:42 +0000
commit3bf78d3be26e89446da009f5c5e562d8ba1a1179 (patch)
treead6d3c452b2626d6643772b84fef9585f0dd5c22 /gcc
parent0fe4610e618b184172ecaa49fb4729e7c349025c (diff)
downloadgcc-3bf78d3be26e89446da009f5c5e562d8ba1a1179.zip
gcc-3bf78d3be26e89446da009f5c5e562d8ba1a1179.tar.gz
gcc-3bf78d3be26e89446da009f5c5e562d8ba1a1179.tar.bz2
optabs.c (expand_abs): Don't call do_jump_by_parts_greater_rtx directly...
* 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. From-SVN: r110954
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 53af55e..6ffd332 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 86dc6f4..da162d6 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 537ce1e..92d8d28 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 f1cf081..d52d57a 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 bdbb88c..0ab8406 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);