This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add vcond_gen_code optab and expand VEC_COND_EXPR


On Thu, Sep 23, 2004 at 02:38:48PM -0700, Devang Patel wrote:
> !   /* Do not emit cmp instructions for vectors here. expand_vec_cond_expr() will
> !      emit appropriate instruction.  */
> !   if (VECTOR_MODE_P (mode))
> !     return gen_rtx_fmt_ee (code, VOIDmode, op0, op1);

You don't need this change, corresponding with not needing ...

> +   /* Get comparison rtx.  */
> +   comparison = compare_from_rtx (rtx_op0, rtx_op1, rcode, unsignedp, 
> + 				 TYPE_MODE (TREE_TYPE (cond)), NULL_RTX);

... this later.

> !   else if (TREE_CODE (exp) == VEC_COND_EXPR
> ! 	   && VECTOR_MODE_P (GET_MODE (target)))
> !       {
> ! 	target = expand_vec_cond_expr (exp, target);
> ! 	return target;

This should go in expand_expr_real_1.  And no check for VECTOR_MODE_P.

> +   if (TREE_CODE_CLASS (TREE_CODE (cond)) != '<')
> +     {
> +       /* This is unlikely. While generating VEC_COND_EXPR,
> + 	 auto vectorizer ensures that condition is a relational
> + 	 operation. Replace 'cond' with 'cond != 0'.  */
> +       rcode = NE_EXPR;
> +       t_op0 = cond;
> +       t_op1 = build_zero_vector (TREE_TYPE (cond));

This should be an abort, I think.  You can't do anything useful here.

> + 
> + 
> + 
> +   return comparison;

Watch your whitespace.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]