Commit dd0ba281 by Roger Sayle Committed by Roger Sayle

cse.c (constant_pool_entries_regcost): New global variable to hold the register…

cse.c (constant_pool_entries_regcost): New global variable to hold the register cost component of...


	* cse.c (constant_pool_entries_regcost): New global variable to
	hold the register cost component of constant_pool_entries_cost.
	(fold_rtx): Calculate constant_pool_entries_regcost at the same
	time as constant_pool_entries_cost.
	(cse_insn): Set both src_folded_cost and src_folded_regcost from
	constant_pool_entries_cost and constant_pool_entries_regcost.
	(cse_main): Initialize constant_pool_entries_regcost to zero.

	* optabs.c (expand_unop): Attach a REG_EQUAL note describing
	the semantics of the sequence of bit operations used to negate
	a floating-point value.
	(expand_abs_nojump): Likewise attach a REG_EQUAL note describing
	the semantics of the bit operations used to abs a floating point
	value.

From-SVN: r72326
parent 796d7a86
2003-10-10 Roger Sayle <roger@eyesopen.com>
* cse.c (constant_pool_entries_regcost): New global variable to
hold the register cost component of constant_pool_entries_cost.
(fold_rtx): Calculate constant_pool_entries_regcost at the same
time as constant_pool_entries_cost.
(cse_insn): Set both src_folded_cost and src_folded_regcost from
constant_pool_entries_cost and constant_pool_entries_regcost.
(cse_main): Initialize constant_pool_entries_regcost to zero.
* optabs.c (expand_unop): Attach a REG_EQUAL note describing
the semantics of the sequence of bit operations used to negate
a floating-point value.
(expand_abs_nojump): Likewise attach a REG_EQUAL note describing
the semantics of the bit operations used to abs a floating point
value.
2003-10-11 Bernardo Innocenti <bernie@develer.com> 2003-10-11 Bernardo Innocenti <bernie@develer.com>
Paul Dale <pauli@snapgear.com> Paul Dale <pauli@snapgear.com>
......
...@@ -569,6 +569,7 @@ static struct table_elt *last_jump_equiv_class; ...@@ -569,6 +569,7 @@ static struct table_elt *last_jump_equiv_class;
the insn. */ the insn. */
static int constant_pool_entries_cost; static int constant_pool_entries_cost;
static int constant_pool_entries_regcost;
/* This data describes a block that will be processed by cse_basic_block. */ /* This data describes a block that will be processed by cse_basic_block. */
...@@ -3529,7 +3530,10 @@ fold_rtx (rtx x, rtx insn) ...@@ -3529,7 +3530,10 @@ fold_rtx (rtx x, rtx insn)
rtx new; rtx new;
if (CONSTANT_P (constant) && GET_CODE (constant) != CONST_INT) if (CONSTANT_P (constant) && GET_CODE (constant) != CONST_INT)
constant_pool_entries_cost = COST (constant); {
constant_pool_entries_cost = COST (constant);
constant_pool_entries_regcost = approx_reg_cost (constant);
}
/* If we are loading the full constant, we have an equivalence. */ /* If we are loading the full constant, we have an equivalence. */
if (offset == 0 && mode == const_mode) if (offset == 0 && mode == const_mode)
...@@ -5507,6 +5511,7 @@ cse_insn (rtx insn, rtx libcall_insn) ...@@ -5507,6 +5511,7 @@ cse_insn (rtx insn, rtx libcall_insn)
src_folded_force_flag = 1; src_folded_force_flag = 1;
src_folded = trial; src_folded = trial;
src_folded_cost = constant_pool_entries_cost; src_folded_cost = constant_pool_entries_cost;
src_folded_regcost = constant_pool_entries_regcost;
} }
} }
...@@ -6939,6 +6944,7 @@ cse_main (rtx f, int nregs, int after_loop, FILE *file) ...@@ -6939,6 +6944,7 @@ cse_main (rtx f, int nregs, int after_loop, FILE *file)
cse_jumps_altered = 0; cse_jumps_altered = 0;
recorded_label_ref = 0; recorded_label_ref = 0;
constant_pool_entries_cost = 0; constant_pool_entries_cost = 0;
constant_pool_entries_regcost = 0;
val.path_size = 0; val.path_size = 0;
init_recog (); init_recog ();
......
...@@ -2615,7 +2615,16 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, ...@@ -2615,7 +2615,16 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
immed_double_const (lo, hi, imode), immed_double_const (lo, hi, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN); NULL_RTX, 1, OPTAB_LIB_WIDEN);
if (temp != 0) if (temp != 0)
return gen_lowpart (mode, temp); {
rtx insn;
if (target == 0)
target = gen_reg_rtx (mode);
insn = emit_move_insn (target, gen_lowpart (mode, temp));
set_unique_reg_note (insn, REG_EQUAL,
gen_rtx_fmt_e (NEG, mode,
copy_rtx (op0)));
return target;
}
delete_insns_since (last); delete_insns_since (last);
} }
} }
...@@ -2790,7 +2799,16 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target, ...@@ -2790,7 +2799,16 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
immed_double_const (~lo, ~hi, imode), immed_double_const (~lo, ~hi, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN); NULL_RTX, 1, OPTAB_LIB_WIDEN);
if (temp != 0) if (temp != 0)
return gen_lowpart (mode, temp); {
rtx insn;
if (target == 0)
target = gen_reg_rtx (mode);
insn = emit_move_insn (target, gen_lowpart (mode, temp));
set_unique_reg_note (insn, REG_EQUAL,
gen_rtx_fmt_e (ABS, mode,
copy_rtx (op0)));
return target;
}
delete_insns_since (last); delete_insns_since (last);
} }
} }
......
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