Commit 3bf78d3b by Roger Sayle Committed by Roger Sayle

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
parent 0fe4610e
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> 2006-02-13 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa/quadlib.c: Use defines instead of enum qfcmp_magic. * pa/quadlib.c: Use defines instead of enum qfcmp_magic.
......
...@@ -609,29 +609,11 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) ...@@ -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. /* Compare OP0 with OP1, word at a time, in mode MODE.
UNSIGNEDP says to do unsigned comparison. UNSIGNEDP says to do unsigned comparison.
Jump to IF_TRUE_LABEL if OP0 is greater, IF_FALSE_LABEL otherwise. */ 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, do_jump_by_parts_greater_rtx (enum machine_mode mode, int unsignedp, rtx op0,
rtx op1, rtx if_false_label, rtx if_true_label) 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, ...@@ -677,6 +659,24 @@ do_jump_by_parts_greater_rtx (enum machine_mode mode, int unsignedp, rtx op0,
if (drop_through_label) if (drop_through_label)
emit_label (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 /* 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 mode, MODE, that is too wide for the available compare insns. Either
......
...@@ -8184,24 +8184,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8184,24 +8184,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
emit_move_insn (target, op0); emit_move_insn (target, op0);
temp = gen_label_rtx (); temp = gen_label_rtx ();
do_compare_rtx_and_jump (target, cmpop1, comparison_code,
/* If this mode is an integer too wide to compare properly, unsignedp, mode, NULL_RTX, NULL_RTX, temp);
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);
}
} }
emit_move_insn (target, op1); emit_move_insn (target, op1);
emit_label (temp); emit_label (temp);
......
...@@ -743,9 +743,6 @@ extern void init_all_optabs (void); ...@@ -743,9 +743,6 @@ extern void init_all_optabs (void);
/* Call this to initialize an optab function entry. */ /* Call this to initialize an optab function entry. */
extern rtx init_one_libfunc (const char *); 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); extern int vector_mode_valid_p (enum machine_mode);
#endif /* GCC_EXPR_H */ #endif /* GCC_EXPR_H */
...@@ -2898,15 +2898,8 @@ expand_abs (enum machine_mode mode, rtx op0, rtx target, ...@@ -2898,15 +2898,8 @@ expand_abs (enum machine_mode mode, rtx op0, rtx target,
emit_move_insn (target, op0); emit_move_insn (target, op0);
NO_DEFER_POP; NO_DEFER_POP;
/* If this mode is an integer too wide to compare properly, do_compare_rtx_and_jump (target, CONST0_RTX (mode), GE, 0, mode,
compare word by word. Rely on CSE to optimize constant cases. */ NULL_RTX, NULL_RTX, op1);
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);
op0 = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab, op0 = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
target, target, 0); target, target, 0);
......
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