> - tree lhs = gimple_assign_lhs (g);
> enum machine_mode mode = TYPE_MODE (TREE_TYPE (lhs));
> rtx target = gen_reg_rtx (mode);
> +
> + start_sequence ();
> tmp = emit_cstore (target, icode, NE, cc_mode, cc_mode,
> 0, tmp, const0_rtx, 1, mode);
> if (tmp)
> - return tmp;
> + {
> + rtx seq = get_insns ();
> + end_sequence ();
> + emit_insn (prep_seq);
> + emit_insn (gen_seq);
> + emit_insn (seq);
> + return tmp;
> + }
> + end_sequence ();
Given that you're already doing delete_insns_since (last)
at the end of this function, I don't think you need a new
sequence around the emit_cstore. Just
emit_insn (prep_seq);
emit_insn (gen_seq);
tmp = emit_cstore (...);
if (tmp)
return tmp;
> + int unsignedp = code == LTU || code == LEU || code == GTU || code == GEU;
You don't need to examine the code, you can look at the argument:
TYPE_UNSIGNED (TREE_TYPE (treeop0))
> + op0 = prepare_operand (icode, op0, 2, op_mode, cmp_mode, unsignedp);
> + op1 = prepare_operand (icode, op1, 3, op_mode, cmp_mode, unsignedp);
> + if (!op0 || !op1)
> + {
> + end_sequence ();
> + return NULL_RTX;
> + }
> + *prep_seq = get_insns ();
> + end_sequence ();
> +
> + cmp = gen_rtx_fmt_ee ((enum rtx_code) code, cmp_mode, op0, op1);
> + target = gen_rtx_REG (CCmode, CC_REGNUM);
> +
> + create_output_operand (&ops[0], target, CCmode);
> + create_fixed_operand (&ops[1], cmp);
> + create_fixed_operand (&ops[2], op0);
> + create_fixed_operand (&ops[3], op1);
Hmm. With so many fixed operands, I think you may be better off not
creating the cmp<mode> expander in the first place. Just inline the
SELECT_CC_MODE and everything right here.
r~