\f
/* Add a REG_EQUAL note to the last insn in INSNS. TARGET is being set to
the result of operation CODE applied to OP0 (and OP1 if it is a binary
- operation).
+ operation). OP0_MODE is OP0's mode.
If the last insn does not set TARGET, don't do anything, but return 1.
try again, ensuring that TARGET is not one of the operands. */
static int
-add_equal_note (rtx_insn *insns, rtx target, enum rtx_code code, rtx op0, rtx op1)
+add_equal_note (rtx_insn *insns, rtx target, enum rtx_code code, rtx op0,
+ rtx op1, machine_mode op0_mode)
{
rtx_insn *last_insn;
rtx set;
case POPCOUNT:
case PARITY:
case BSWAP:
- if (GET_MODE (op0) != VOIDmode && GET_MODE (target) != GET_MODE (op0))
+ if (op0_mode != VOIDmode && GET_MODE (target) != op0_mode)
{
- note = gen_rtx_fmt_e (code, GET_MODE (op0), copy_rtx (op0));
- if (GET_MODE_UNIT_SIZE (GET_MODE (op0))
+ note = gen_rtx_fmt_e (code, op0_mode, copy_rtx (op0));
+ if (GET_MODE_UNIT_SIZE (op0_mode)
> GET_MODE_UNIT_SIZE (GET_MODE (target)))
note = simplify_gen_unary (TRUNCATE, GET_MODE (target),
- note, GET_MODE (op0));
+ note, op0_mode);
else
note = simplify_gen_unary (ZERO_EXTEND, GET_MODE (target),
- note, GET_MODE (op0));
+ note, op0_mode);
break;
}
/* FALLTHRU */
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
&& ! add_equal_note (pat, ops[0].value,
optab_to_code (binoptab),
- ops[1].value, ops[2].value))
+ ops[1].value, ops[2].value, mode0))
{
delete_insns_since (last);
return expand_binop (mode, binoptab, op0, op1, NULL_RTX,
seq = get_insns ();
end_sequence ();
- add_equal_note (seq, target, CLZ, xop0, 0);
+ add_equal_note (seq, target, CLZ, xop0, NULL_RTX, mode);
emit_insn (seq);
return target;
seq = get_insns ();
end_sequence ();
- add_equal_note (seq, t, POPCOUNT, op0, 0);
+ add_equal_note (seq, t, POPCOUNT, op0, NULL_RTX, mode);
emit_insn (seq);
return t;
}
seq = get_insns ();
end_sequence ();
- add_equal_note (seq, temp, CTZ, op0, 0);
+ add_equal_note (seq, temp, CTZ, op0, NULL_RTX, mode);
emit_insn (seq);
return temp;
}
seq = get_insns ();
end_sequence ();
- add_equal_note (seq, temp, FFS, op0, 0);
+ add_equal_note (seq, temp, FFS, op0, NULL_RTX, mode);
emit_insn (seq);
return temp;
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
&& ! add_equal_note (pat, ops[0].value,
optab_to_code (unoptab),
- ops[1].value, NULL_RTX))
+ ops[1].value, NULL_RTX, mode))
{
delete_insns_since (last);
return expand_unop (mode, unoptab, op0, NULL_RTX, unsignedp);
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
&& code != UNKNOWN)
- add_equal_note (pat, ops[0].value, code, ops[1].value, NULL_RTX);
+ add_equal_note (pat, ops[0].value, code, ops[1].value, NULL_RTX,
+ GET_MODE (op0));
emit_insn (pat);