This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] expand_sdiv_pow2 improvements for cmove targets (take 2)
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 Aug 2004 12:43:40 -0700
- Subject: Re: [PATCH] expand_sdiv_pow2 improvements for cmove targets (take 2)
- References: <20040726004113.GB11405@redhat.com> <Pine.LNX.4.44.0408021739250.17605-100000@www.eyesopen.com>
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~