Commit 794693c0 by Richard Henderson Committed by Richard Henderson

cse.c (record_jump_cond_subreg): New.

        * cse.c (record_jump_cond_subreg): New.
        (record_jump_cond): Use it instead of gen_lowpart.

From-SVN: r91119
parent 7a32a925
2004-11-23 Richard Henderson <rth@redhat.com>
* cse.c (record_jump_cond_subreg): New.
(record_jump_cond): Use it instead of gen_lowpart.
2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com> Joseph Myers <joseph@codesourcery.com>
......
...@@ -4335,6 +4335,18 @@ record_jump_equiv (rtx insn, int taken) ...@@ -4335,6 +4335,18 @@ record_jump_equiv (rtx insn, int taken)
record_jump_cond (code, mode, op0, op1, reversed_nonequality); record_jump_cond (code, mode, op0, op1, reversed_nonequality);
} }
/* Yet another form of subreg creation. In this case, we want something in
MODE, and we should assume OP has MODE iff it is naturally modeless. */
static rtx
record_jump_cond_subreg (enum machine_mode mode, rtx op)
{
enum machine_mode op_mode = GET_MODE (op);
if (op_mode == mode || op_mode == VOIDmode)
return op;
return lowpart_subreg (mode, op, op_mode);
}
/* We know that comparison CODE applied to OP0 and OP1 in MODE is true. /* We know that comparison CODE applied to OP0 and OP1 in MODE is true.
REVERSED_NONEQUALITY is nonzero if CODE had to be swapped. REVERSED_NONEQUALITY is nonzero if CODE had to be swapped.
Make any useful entries we can with that information. Called from Make any useful entries we can with that information. Called from
...@@ -4359,10 +4371,9 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0, ...@@ -4359,10 +4371,9 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0,
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0))))) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))))
{ {
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0)); enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0));
rtx tem = gen_lowpart (inner_mode, op1); rtx tem = record_jump_cond_subreg (inner_mode, op1);
if (tem)
record_jump_cond (code, mode, SUBREG_REG (op0), record_jump_cond (code, mode, SUBREG_REG (op0), tem,
tem ? tem : gen_rtx_SUBREG (inner_mode, op1, 0),
reversed_nonequality); reversed_nonequality);
} }
...@@ -4371,10 +4382,9 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0, ...@@ -4371,10 +4382,9 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0,
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1))))) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1)))))
{ {
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op1)); enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op1));
rtx tem = gen_lowpart (inner_mode, op0); rtx tem = record_jump_cond_subreg (inner_mode, op0);
if (tem)
record_jump_cond (code, mode, SUBREG_REG (op1), record_jump_cond (code, mode, SUBREG_REG (op1), tem,
tem ? tem : gen_rtx_SUBREG (inner_mode, op0, 0),
reversed_nonequality); reversed_nonequality);
} }
...@@ -4391,10 +4401,9 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0, ...@@ -4391,10 +4401,9 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0,
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0))))) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))))
{ {
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0)); enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0));
rtx tem = gen_lowpart (inner_mode, op1); rtx tem = record_jump_cond_subreg (inner_mode, op1);
if (tem)
record_jump_cond (code, mode, SUBREG_REG (op0), record_jump_cond (code, mode, SUBREG_REG (op0), tem,
tem ? tem : gen_rtx_SUBREG (inner_mode, op1, 0),
reversed_nonequality); reversed_nonequality);
} }
...@@ -4404,10 +4413,9 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0, ...@@ -4404,10 +4413,9 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0,
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1))))) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1)))))
{ {
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op1)); enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op1));
rtx tem = gen_lowpart (inner_mode, op0); rtx tem = record_jump_cond_subreg (inner_mode, op0);
if (tem)
record_jump_cond (code, mode, SUBREG_REG (op1), record_jump_cond (code, mode, SUBREG_REG (op1), tem,
tem ? tem : gen_rtx_SUBREG (inner_mode, op0, 0),
reversed_nonequality); reversed_nonequality);
} }
......
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