Commit 65c5ae8b by Paolo Bonzini Committed by Paolo Bonzini

sparc.c (sparc_compare_emitted): Remove.

2009-03-30  Paolo Bonzini  <bonzini@gnu.org>

	* config/sparc/sparc.c (sparc_compare_emitted): Remove.
	(gen_compare_reg, emit_v9_brxx_insn): Handle MODE_CC
	sparc_compare_op0 like sparc_compare_emitted used to be handled.
	(sparc_expand_compare_and_swap_12): Set sparc_compare_op0
	instead of sparc_compare_emitted.
	* config/sparc/sparc.h (sparc_compare_emitted): Remove.
	* config/sparc/sparc.md (stack_protect_test): Set sparc_compare_op0
	instead of sparc_compare_emitted.

From-SVN: r145284
parent d25aa7ab
2009-03-30 Paolo Bonzini <bonzini@gnu.org> 2009-03-30 Paolo Bonzini <bonzini@gnu.org>
* config/sparc/sparc.c (sparc_compare_emitted): Remove.
(gen_compare_reg, emit_v9_brxx_insn): Handle MODE_CC
sparc_compare_op0 like sparc_compare_emitted used to be handled.
(sparc_expand_compare_and_swap_12): Set sparc_compare_op0
instead of sparc_compare_emitted.
* config/sparc/sparc.h (sparc_compare_emitted): Remove.
* config/sparc/sparc.md (stack_protect_test): Set sparc_compare_op0
instead of sparc_compare_emitted.
2009-03-30 Paolo Bonzini <bonzini@gnu.org>
* bb-reorder.c (partition_hot_cold_basic_blocks): Do not * bb-reorder.c (partition_hot_cold_basic_blocks): Do not
enter/exit cfglayout mode. enter/exit cfglayout mode.
(pass_partition_block): Require it. (pass_partition_block): Require it.
......
...@@ -282,7 +282,7 @@ static GTY(()) alias_set_type struct_value_alias_set; ...@@ -282,7 +282,7 @@ static GTY(()) alias_set_type struct_value_alias_set;
/* Save the operands last given to a compare for use when we /* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */ generate a scc or bcc insn. */
rtx sparc_compare_op0, sparc_compare_op1, sparc_compare_emitted; rtx sparc_compare_op0, sparc_compare_op1;
/* Vector to say how input registers are mapped to output registers. /* Vector to say how input registers are mapped to output registers.
HARD_FRAME_POINTER_REGNUM cannot be remapped by this function to HARD_FRAME_POINTER_REGNUM cannot be remapped by this function to
...@@ -2006,17 +2006,15 @@ select_cc_mode (enum rtx_code op, rtx x, rtx y ATTRIBUTE_UNUSED) ...@@ -2006,17 +2006,15 @@ select_cc_mode (enum rtx_code op, rtx x, rtx y ATTRIBUTE_UNUSED)
rtx rtx
gen_compare_reg (enum rtx_code code) gen_compare_reg (enum rtx_code code)
{ {
rtx x = sparc_compare_op0; enum machine_mode mode;
rtx y = sparc_compare_op1; rtx x, y, cc_reg;
enum machine_mode mode = SELECT_CC_MODE (code, x, y);
rtx cc_reg;
if (sparc_compare_emitted != NULL_RTX) if (GET_MODE_CLASS (GET_MODE (sparc_compare_op0)) == MODE_CC)
{ return sparc_compare_op0;
cc_reg = sparc_compare_emitted;
sparc_compare_emitted = NULL_RTX; x = sparc_compare_op0;
return cc_reg; y = sparc_compare_op1;
} mode = SELECT_CC_MODE (code, x, y);
/* ??? We don't have movcc patterns so we cannot generate pseudo regs for the /* ??? We don't have movcc patterns so we cannot generate pseudo regs for the
fcc regs (cse can't tell they're really call clobbered regs and will fcc regs (cse can't tell they're really call clobbered regs and will
...@@ -2198,7 +2196,7 @@ gen_v9_scc (enum rtx_code compare_code, register rtx *operands) ...@@ -2198,7 +2196,7 @@ gen_v9_scc (enum rtx_code compare_code, register rtx *operands)
void void
emit_v9_brxx_insn (enum rtx_code code, rtx op0, rtx label) emit_v9_brxx_insn (enum rtx_code code, rtx op0, rtx label)
{ {
gcc_assert (sparc_compare_emitted == NULL_RTX); gcc_assert (GET_MODE_CLASS (GET_MODE (sparc_compare_op0)) != MODE_CC);
emit_jump_insn (gen_rtx_SET (VOIDmode, emit_jump_insn (gen_rtx_SET (VOIDmode,
pc_rtx, pc_rtx,
gen_rtx_IF_THEN_ELSE (VOIDmode, gen_rtx_IF_THEN_ELSE (VOIDmode,
...@@ -9026,7 +9024,8 @@ sparc_expand_compare_and_swap_12 (rtx result, rtx mem, rtx oldval, rtx newval) ...@@ -9026,7 +9024,8 @@ sparc_expand_compare_and_swap_12 (rtx result, rtx mem, rtx oldval, rtx newval)
emit_insn (gen_rtx_SET (VOIDmode, val, resv)); emit_insn (gen_rtx_SET (VOIDmode, val, resv));
sparc_compare_emitted = cc; sparc_compare_op0 = cc;
sparc_compare_op1 = const0_rtx;
emit_jump_insn (gen_bne (loop_label)); emit_jump_insn (gen_bne (loop_label));
emit_label (end_label); emit_label (end_label);
......
...@@ -1558,12 +1558,10 @@ function_arg_padding ((MODE), (TYPE)) ...@@ -1558,12 +1558,10 @@ function_arg_padding ((MODE), (TYPE))
? 128 : PARM_BOUNDARY) ? 128 : PARM_BOUNDARY)
/* Define the information needed to generate branch and scc insns. This is /* Define the information needed to generate branch and scc insns. This is
stored from the compare operation. Note that we can't use "rtx" here stored from the compare operation. */
since it hasn't been defined! */
extern GTY(()) rtx sparc_compare_op0; extern GTY(()) rtx sparc_compare_op0;
extern GTY(()) rtx sparc_compare_op1; extern GTY(()) rtx sparc_compare_op1;
extern GTY(()) rtx sparc_compare_emitted;
/* Generate the special assembly code needed to tell the assembler whatever /* Generate the special assembly code needed to tell the assembler whatever
......
...@@ -8076,9 +8076,8 @@ ...@@ -8076,9 +8076,8 @@
else else
{ {
emit_insn (gen_stack_protect_testsi (operands[0], operands[1])); emit_insn (gen_stack_protect_testsi (operands[0], operands[1]));
sparc_compare_op0 = operands[0]; sparc_compare_op0 = gen_rtx_REG (CCmode, SPARC_ICC_REG);
sparc_compare_op1 = operands[1]; sparc_compare_op1 = const0_rtx;
sparc_compare_emitted = gen_rtx_REG (CCmode, SPARC_ICC_REG);
} }
emit_jump_insn (gen_beq (operands[2])); emit_jump_insn (gen_beq (operands[2]));
DONE; DONE;
......
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