[PATCH] expand_sdiv_pow2 improvements for cmove targets (take 2)

Richard Henderson rth@redhat.com
Tue Aug 3 19:46:00 GMT 2004


On Mon, Aug 02, 2004 at 06:06:02PM -0600, Roger Sayle wrote:
> ! #ifdef HAVE_conditional_move
> ! static bool have_cmovlt_p[NUM_MACHINE_MODES];
> ! #endif

You don't need this, or all of the other bits that compute it.

> + #ifdef HAVE_conditional_move
> +   if (have_cmovlt_p[mode] && BRANCH_COST >= 2)
> +     {
> +       rtx temp2;
> +
> +       temp2 = copy_to_mode_reg (mode, op0);
> +       temp = expand_binop (mode, add_optab, temp2, GEN_INT (d-1),
> + 			   NULL_RTX, 0, OPTAB_LIB_WIDEN);
> +       temp = force_reg (mode, temp);
> +
> +       /* Construct "temp2 = (temp2 < 0) ? temp : temp2".  */
> +       temp2 = emit_conditional_move (temp2, LT, temp2, const0_rtx,
> + 				     mode, temp, temp2, mode, 0);
> +       return expand_shift (RSHIFT_EXPR, mode, temp2, shift, NULL_RTX, 0);
> +     }
> + #endif

Just do the emit_conditional_move and allow it to fail.


r~



More information about the Gcc-patches mailing list