Commit f3f6fb16 by David Malcolm Committed by David Malcolm

expmed.c: Use rtx_insn and rtx_code_label

gcc/
	* expmed.c (store_bit_field_using_insv): Strengthen local "last"
	from rtx to rtx_insn *.
	(store_bit_field_1): Likewise.
	(extract_bit_field_1): Likewise.
	(expand_mult_const): Likewise for local "insns".
	(expmed_mult_highpart): Strengthen local "label" from rtx to
	rtx_code_label *.
	(expand_smod_pow2): Likewise.
	(expand_sdiv_pow2): Likewise.
	(expand_divmod): Strengthen locals "last", "insn" from rtx to
	rtx_insn *.  Strengthen locals "label", "label1", "label2",
	"label3", "label4", "label5", "lab" from rtx to rtx_code_label *.
	(emit_cstore): Strengthen local "last" from rtx to rtx_insn *.
	(emit_store_flag): Likewise.
	(emit_store_flag_force): Strengthen local "label" from rtx to
	rtx_code_label *.
	(do_cmp_and_jump): Likewise for param "label".

From-SVN: r214323
parent 528a80c1
2014-08-22 David Malcolm <dmalcolm@redhat.com> 2014-08-22 David Malcolm <dmalcolm@redhat.com>
* expmed.c (store_bit_field_using_insv): Strengthen local "last"
from rtx to rtx_insn *.
(store_bit_field_1): Likewise.
(extract_bit_field_1): Likewise.
(expand_mult_const): Likewise for local "insns".
(expmed_mult_highpart): Strengthen local "label" from rtx to
rtx_code_label *.
(expand_smod_pow2): Likewise.
(expand_sdiv_pow2): Likewise.
(expand_divmod): Strengthen locals "last", "insn" from rtx to
rtx_insn *. Strengthen locals "label", "label1", "label2",
"label3", "label4", "label5", "lab" from rtx to rtx_code_label *.
(emit_cstore): Strengthen local "last" from rtx to rtx_insn *.
(emit_store_flag): Likewise.
(emit_store_flag_force): Strengthen local "label" from rtx to
rtx_code_label *.
(do_cmp_and_jump): Likewise for param "label".
2014-08-22 David Malcolm <dmalcolm@redhat.com>
* explow.c (force_reg): Strengthen local "insn" from rtx to * explow.c (force_reg): Strengthen local "insn" from rtx to
rtx_insn *. rtx_insn *.
(adjust_stack_1): Likewise. (adjust_stack_1): Likewise.
......
...@@ -65,7 +65,7 @@ static rtx extract_fixed_bit_field_1 (enum machine_mode, rtx, ...@@ -65,7 +65,7 @@ static rtx extract_fixed_bit_field_1 (enum machine_mode, rtx,
static rtx lshift_value (enum machine_mode, unsigned HOST_WIDE_INT, int); static rtx lshift_value (enum machine_mode, unsigned HOST_WIDE_INT, int);
static rtx extract_split_bit_field (rtx, unsigned HOST_WIDE_INT, static rtx extract_split_bit_field (rtx, unsigned HOST_WIDE_INT,
unsigned HOST_WIDE_INT, int); unsigned HOST_WIDE_INT, int);
static void do_cmp_and_jump (rtx, rtx, enum rtx_code, enum machine_mode, rtx); static void do_cmp_and_jump (rtx, rtx, enum rtx_code, enum machine_mode, rtx_code_label *);
static rtx expand_smod_pow2 (enum machine_mode, rtx, HOST_WIDE_INT); static rtx expand_smod_pow2 (enum machine_mode, rtx, HOST_WIDE_INT);
static rtx expand_sdiv_pow2 (enum machine_mode, rtx, HOST_WIDE_INT); static rtx expand_sdiv_pow2 (enum machine_mode, rtx, HOST_WIDE_INT);
...@@ -482,7 +482,7 @@ store_bit_field_using_insv (const extraction_insn *insv, rtx op0, ...@@ -482,7 +482,7 @@ store_bit_field_using_insv (const extraction_insn *insv, rtx op0,
struct expand_operand ops[4]; struct expand_operand ops[4];
rtx value1; rtx value1;
rtx xop0 = op0; rtx xop0 = op0;
rtx last = get_last_insn (); rtx_insn *last = get_last_insn ();
bool copy_back = false; bool copy_back = false;
enum machine_mode op_mode = insv->field_mode; enum machine_mode op_mode = insv->field_mode;
...@@ -768,7 +768,7 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, ...@@ -768,7 +768,7 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
unsigned int backwards = WORDS_BIG_ENDIAN && fieldmode != BLKmode; unsigned int backwards = WORDS_BIG_ENDIAN && fieldmode != BLKmode;
unsigned int nwords = (bitsize + (BITS_PER_WORD - 1)) / BITS_PER_WORD; unsigned int nwords = (bitsize + (BITS_PER_WORD - 1)) / BITS_PER_WORD;
unsigned int i; unsigned int i;
rtx last; rtx_insn *last;
/* This is the mode we must force value to, so that there will be enough /* This is the mode we must force value to, so that there will be enough
subwords to extract. Note that fieldmode will often (always?) be subwords to extract. Note that fieldmode will often (always?) be
...@@ -874,7 +874,7 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, ...@@ -874,7 +874,7 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
&& store_bit_field_using_insv (&insv, op0, bitsize, bitnum, value)) && store_bit_field_using_insv (&insv, op0, bitsize, bitnum, value))
return true; return true;
rtx last = get_last_insn (); rtx_insn *last = get_last_insn ();
/* Try loading part of OP0 into a register, inserting the bitfield /* Try loading part of OP0 into a register, inserting the bitfield
into that, and then copying the result back to OP0. */ into that, and then copying the result back to OP0. */
...@@ -1553,7 +1553,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, ...@@ -1553,7 +1553,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
unsigned int backwards = WORDS_BIG_ENDIAN; unsigned int backwards = WORDS_BIG_ENDIAN;
unsigned int nwords = (bitsize + (BITS_PER_WORD - 1)) / BITS_PER_WORD; unsigned int nwords = (bitsize + (BITS_PER_WORD - 1)) / BITS_PER_WORD;
unsigned int i; unsigned int i;
rtx last; rtx_insn *last;
if (target == 0 || !REG_P (target) || !valid_multiword_target_p (target)) if (target == 0 || !REG_P (target) || !valid_multiword_target_p (target))
target = gen_reg_rtx (mode); target = gen_reg_rtx (mode);
...@@ -1671,7 +1671,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, ...@@ -1671,7 +1671,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
return result; return result;
} }
rtx last = get_last_insn (); rtx_insn *last = get_last_insn ();
/* Try loading part of OP0 into a register and extracting the /* Try loading part of OP0 into a register and extracting the
bitfield from that. */ bitfield from that. */
...@@ -2906,7 +2906,8 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, ...@@ -2906,7 +2906,8 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val,
enum mult_variant variant) enum mult_variant variant)
{ {
HOST_WIDE_INT val_so_far; HOST_WIDE_INT val_so_far;
rtx insn, accum, tem; rtx_insn *insn;
rtx accum, tem;
int opno; int opno;
enum machine_mode nmode; enum machine_mode nmode;
...@@ -3503,7 +3504,8 @@ expmed_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1, ...@@ -3503,7 +3504,8 @@ expmed_mult_highpart_optab (enum machine_mode mode, rtx op0, rtx op1,
&& (mul_cost (speed, wider_mode) + shift_cost (speed, mode, size-1) && (mul_cost (speed, wider_mode) + shift_cost (speed, mode, size-1)
< max_cost)) < max_cost))
{ {
rtx insns, wop0, wop1; rtx_insn *insns;
rtx wop0, wop1;
/* We need to widen the operands, for example to ensure the /* We need to widen the operands, for example to ensure the
constant multiplier is correctly sign or zero extended. constant multiplier is correctly sign or zero extended.
...@@ -3624,7 +3626,8 @@ expmed_mult_highpart (enum machine_mode mode, rtx op0, rtx op1, ...@@ -3624,7 +3626,8 @@ expmed_mult_highpart (enum machine_mode mode, rtx op0, rtx op1,
static rtx static rtx
expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
{ {
rtx result, temp, shift, label; rtx result, temp, shift;
rtx_code_label *label;
int logd; int logd;
int prec = GET_MODE_PRECISION (mode); int prec = GET_MODE_PRECISION (mode);
...@@ -3720,7 +3723,8 @@ expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) ...@@ -3720,7 +3723,8 @@ expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
static rtx static rtx
expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
{ {
rtx temp, label; rtx temp;
rtx_code_label *label;
int logd; int logd;
logd = floor_log2 (d); logd = floor_log2 (d);
...@@ -3753,7 +3757,7 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) ...@@ -3753,7 +3757,7 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
mode, temp, temp2, mode, 0); mode, temp, temp2, mode, 0);
if (temp2) if (temp2)
{ {
rtx seq = get_insns (); rtx_insn *seq = get_insns ();
end_sequence (); end_sequence ();
emit_insn (seq); emit_insn (seq);
return expand_shift (RSHIFT_EXPR, mode, temp2, logd, NULL_RTX, 0); return expand_shift (RSHIFT_EXPR, mode, temp2, logd, NULL_RTX, 0);
...@@ -3835,9 +3839,9 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -3835,9 +3839,9 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
enum machine_mode compute_mode; enum machine_mode compute_mode;
rtx tquotient; rtx tquotient;
rtx quotient = 0, remainder = 0; rtx quotient = 0, remainder = 0;
rtx last; rtx_insn *last;
int size; int size;
rtx insn; rtx_insn *insn;
optab optab1, optab2; optab optab1, optab2;
int op1_is_constant, op1_is_pow2 = 0; int op1_is_constant, op1_is_pow2 = 0;
int max_cost, extra_cost; int max_cost, extra_cost;
...@@ -4455,7 +4459,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4455,7 +4459,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
/* This could be computed with a branch-less sequence. /* This could be computed with a branch-less sequence.
Save that for later. */ Save that for later. */
rtx tem; rtx tem;
rtx label = gen_label_rtx (); rtx_code_label *label = gen_label_rtx ();
do_cmp_and_jump (remainder, const0_rtx, EQ, compute_mode, label); do_cmp_and_jump (remainder, const0_rtx, EQ, compute_mode, label);
tem = expand_binop (compute_mode, xor_optab, op0, op1, tem = expand_binop (compute_mode, xor_optab, op0, op1,
NULL_RTX, 0, OPTAB_WIDEN); NULL_RTX, 0, OPTAB_WIDEN);
...@@ -4469,7 +4473,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4469,7 +4473,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
/* No luck with division elimination or divmod. Have to do it /* No luck with division elimination or divmod. Have to do it
by conditionally adjusting op0 *and* the result. */ by conditionally adjusting op0 *and* the result. */
{ {
rtx label1, label2, label3, label4, label5; rtx_code_label *label1, *label2, *label3, *label4, *label5;
rtx adjusted_op0; rtx adjusted_op0;
rtx tem; rtx tem;
...@@ -4530,7 +4534,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4530,7 +4534,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
compute_mode, 1, 1); compute_mode, 1, 1);
if (t3 == 0) if (t3 == 0)
{ {
rtx lab; rtx_code_label *lab;
lab = gen_label_rtx (); lab = gen_label_rtx ();
do_cmp_and_jump (t2, const0_rtx, EQ, compute_mode, lab); do_cmp_and_jump (t2, const0_rtx, EQ, compute_mode, lab);
expand_inc (t1, const1_rtx); expand_inc (t1, const1_rtx);
...@@ -4570,7 +4574,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4570,7 +4574,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
{ {
/* This could be computed with a branch-less sequence. /* This could be computed with a branch-less sequence.
Save that for later. */ Save that for later. */
rtx label = gen_label_rtx (); rtx_code_label *label = gen_label_rtx ();
do_cmp_and_jump (remainder, const0_rtx, EQ, do_cmp_and_jump (remainder, const0_rtx, EQ,
compute_mode, label); compute_mode, label);
expand_inc (quotient, const1_rtx); expand_inc (quotient, const1_rtx);
...@@ -4582,7 +4586,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4582,7 +4586,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
/* No luck with division elimination or divmod. Have to do it /* No luck with division elimination or divmod. Have to do it
by conditionally adjusting op0 *and* the result. */ by conditionally adjusting op0 *and* the result. */
{ {
rtx label1, label2; rtx_code_label *label1, *label2;
rtx adjusted_op0, tem; rtx adjusted_op0, tem;
quotient = gen_reg_rtx (compute_mode); quotient = gen_reg_rtx (compute_mode);
...@@ -4627,7 +4631,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4627,7 +4631,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
compute_mode, 1, 1); compute_mode, 1, 1);
if (t3 == 0) if (t3 == 0)
{ {
rtx lab; rtx_code_label *lab;
lab = gen_label_rtx (); lab = gen_label_rtx ();
do_cmp_and_jump (t2, const0_rtx, EQ, compute_mode, lab); do_cmp_and_jump (t2, const0_rtx, EQ, compute_mode, lab);
expand_inc (t1, const1_rtx); expand_inc (t1, const1_rtx);
...@@ -4667,7 +4671,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4667,7 +4671,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
/* This could be computed with a branch-less sequence. /* This could be computed with a branch-less sequence.
Save that for later. */ Save that for later. */
rtx tem; rtx tem;
rtx label = gen_label_rtx (); rtx_code_label *label = gen_label_rtx ();
do_cmp_and_jump (remainder, const0_rtx, EQ, do_cmp_and_jump (remainder, const0_rtx, EQ,
compute_mode, label); compute_mode, label);
tem = expand_binop (compute_mode, xor_optab, op0, op1, tem = expand_binop (compute_mode, xor_optab, op0, op1,
...@@ -4682,7 +4686,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4682,7 +4686,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
/* No luck with division elimination or divmod. Have to do it /* No luck with division elimination or divmod. Have to do it
by conditionally adjusting op0 *and* the result. */ by conditionally adjusting op0 *and* the result. */
{ {
rtx label1, label2, label3, label4, label5; rtx_code_label *label1, *label2, *label3, *label4, *label5;
rtx adjusted_op0; rtx adjusted_op0;
rtx tem; rtx tem;
...@@ -4757,7 +4761,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4757,7 +4761,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
if (unsignedp) if (unsignedp)
{ {
rtx tem; rtx tem;
rtx label; rtx_code_label *label;
label = gen_label_rtx (); label = gen_label_rtx ();
quotient = gen_reg_rtx (compute_mode); quotient = gen_reg_rtx (compute_mode);
remainder = gen_reg_rtx (compute_mode); remainder = gen_reg_rtx (compute_mode);
...@@ -4780,7 +4784,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, ...@@ -4780,7 +4784,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
else else
{ {
rtx abs_rem, abs_op1, tem, mask; rtx abs_rem, abs_op1, tem, mask;
rtx label; rtx_code_label *label;
label = gen_label_rtx (); label = gen_label_rtx ();
quotient = gen_reg_rtx (compute_mode); quotient = gen_reg_rtx (compute_mode);
remainder = gen_reg_rtx (compute_mode); remainder = gen_reg_rtx (compute_mode);
...@@ -5090,7 +5094,8 @@ emit_cstore (rtx target, enum insn_code icode, enum rtx_code code, ...@@ -5090,7 +5094,8 @@ emit_cstore (rtx target, enum insn_code icode, enum rtx_code code,
enum machine_mode target_mode) enum machine_mode target_mode)
{ {
struct expand_operand ops[4]; struct expand_operand ops[4];
rtx op0, last, comparison, subtarget; rtx op0, comparison, subtarget;
rtx_insn *last;
enum machine_mode result_mode = targetm.cstore_mode (icode); enum machine_mode result_mode = targetm.cstore_mode (icode);
last = get_last_insn (); last = get_last_insn ();
...@@ -5394,7 +5399,8 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1, ...@@ -5394,7 +5399,8 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
enum machine_mode target_mode = target ? GET_MODE (target) : VOIDmode; enum machine_mode target_mode = target ? GET_MODE (target) : VOIDmode;
enum rtx_code rcode; enum rtx_code rcode;
rtx subtarget; rtx subtarget;
rtx tem, last, trueval; rtx tem, trueval;
rtx_insn *last;
/* If we compare constants, we shouldn't use a store-flag operation, /* If we compare constants, we shouldn't use a store-flag operation,
but a constant load. We can get there via the vanilla route that but a constant load. We can get there via the vanilla route that
...@@ -5722,7 +5728,8 @@ rtx ...@@ -5722,7 +5728,8 @@ rtx
emit_store_flag_force (rtx target, enum rtx_code code, rtx op0, rtx op1, emit_store_flag_force (rtx target, enum rtx_code code, rtx op0, rtx op1,
enum machine_mode mode, int unsignedp, int normalizep) enum machine_mode mode, int unsignedp, int normalizep)
{ {
rtx tem, label; rtx tem;
rtx_code_label *label;
rtx trueval, falseval; rtx trueval, falseval;
/* First see if emit_store_flag can do the job. */ /* First see if emit_store_flag can do the job. */
...@@ -5796,7 +5803,7 @@ emit_store_flag_force (rtx target, enum rtx_code code, rtx op0, rtx op1, ...@@ -5796,7 +5803,7 @@ emit_store_flag_force (rtx target, enum rtx_code code, rtx op0, rtx op1,
static void static void
do_cmp_and_jump (rtx arg1, rtx arg2, enum rtx_code op, enum machine_mode mode, do_cmp_and_jump (rtx arg1, rtx arg2, enum rtx_code op, enum machine_mode mode,
rtx label) rtx_code_label *label)
{ {
int unsignedp = (op == LTU || op == LEU || op == GTU || op == GEU); int unsignedp = (op == LTU || op == LEU || op == GTU || op == GEU);
do_compare_rtx_and_jump (arg1, arg2, op, unsignedp, mode, do_compare_rtx_and_jump (arg1, arg2, op, unsignedp, mode,
......
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