public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Change vcond<mode> to vcond<mode1><mode2>
@ 2011-08-29 15:08 Richard Guenther
  2011-08-29 16:36 ` Richard Guenther
  2011-08-29 20:47 ` Uros Bizjak
  0 siblings, 2 replies; 16+ messages in thread
From: Richard Guenther @ 2011-08-29 15:08 UTC (permalink / raw)
  To: gcc-patches; +Cc: uros, rth, artyom.shinkaroff


This patch makes a conversion optab from the direct optabs vcond
and vcondu.  This allows to specify different modes for the
actual comparison and the value that is selected.

All targets but i386 are trivially converted by 
s/vcond<mode>/vcond<mode><mode>/.  The i386 port is enhanced
to support a OP b ? c : d as ({ mask = a OP b; (c & mask) | (d & ~mask); 
}), constraining it to what the middle-end constrained itself to
(matching number of vector elements in the comparison operands with
the result vector types) would explode patterns too much.
Thus, only a subset of mode combinations will be excercised
(but none at the moment - a followup will fix the vectorizer,
and generic vectors from the C extensions have a patch pending).

Bootstrapped on x86_64-unknown-linux-gnu, tests are currently
running for {,-m32}.

Ok if that succeeds?

Thanks,
Richard.

2011-08-29  Richard Guenther  <rguenther@suse.de>

	* genopinit.c (optabs): Turn vcond{,u}_optab into a conversion
	optab with two modes.
	* optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu.
	(enum direct_optab_index): Remove DOI_vcond, DOI_vcondu.
	(vcond_optab): Adjust.
	(vcondu_optab): Likewise.
	(expand_vec_cond_expr_p): Adjust prototype.
	* optabs.c (get_vcond_icode): Adjust.
	(expand_vec_cond_expr_p): Likewise.
	(expand_vec_cond_expr): Likewise.
	* tree-vect-stmt.c (vectorizable_condition): Adjust.

	* config/i386/sse.md (vcond<mode>): Split to
	vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>,
	vcond<V_128:mode><VI124_128:mode> and
	vcondu<V_128:mode><VI124_128:mode>.
	(vcondv2di): Change to vcond<VI8F_128:mode>v2di.
	(vconduv2di): Likewise.
	* config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>.
	(vcondu<mode>): Likewise.
	* config/ia64/vect.md (vcond<mode>): Likewise.
	(vcondu<mode>): Likewise.
	(vcondv2sf): Likewise.
	* config/mips/mips-ps-3d.md (vcondv2sf): Likewise.
	* config/rs6000/paired.md (vcondv2sf): Likewise.
	* config/rs6000/vector.md (vcond<mode>): Likewise.
	(vcondu<mode>): Likewise.
	* config/spu/spu.md (vcond<mode>): Likewise.
	(vcondu<mode>): Likewise.

Index: trunk/gcc/config/arm/neon.md
===================================================================
*** trunk.orig/gcc/config/arm/neon.md	2011-08-15 14:15:34.000000000 +0200
--- trunk/gcc/config/arm/neon.md	2011-08-29 15:56:32.000000000 +0200
***************
*** 1600,1606 ****
  ;; where op3 is <, <=, ==, !=, >= or >.  Operations are performed
  ;; element-wise.
  
! (define_expand "vcond<mode>"
    [(set (match_operand:VDQW 0 "s_register_operand" "")
  	(if_then_else:VDQW
  	  (match_operator 3 "arm_comparison_operator"
--- 1600,1606 ----
  ;; where op3 is <, <=, ==, !=, >= or >.  Operations are performed
  ;; element-wise.
  
! (define_expand "vcond<mode><mode>"
    [(set (match_operand:VDQW 0 "s_register_operand" "")
  	(if_then_else:VDQW
  	  (match_operator 3 "arm_comparison_operator"
***************
*** 1680,1686 ****
    DONE;
  })
  
! (define_expand "vcondu<mode>"
    [(set (match_operand:VDQIW 0 "s_register_operand" "")
  	(if_then_else:VDQIW
  	  (match_operator 3 "arm_comparison_operator"
--- 1680,1686 ----
    DONE;
  })
  
! (define_expand "vcondu<mode><mode>"
    [(set (match_operand:VDQIW 0 "s_register_operand" "")
  	(if_then_else:VDQIW
  	  (match_operator 3 "arm_comparison_operator"
Index: trunk/gcc/config/i386/sse.md
===================================================================
*** trunk.orig/gcc/config/i386/sse.md	2011-08-29 15:07:05.000000000 +0200
--- trunk/gcc/config/i386/sse.md	2011-08-29 15:55:44.000000000 +0200
***************
*** 1405,1418 ****
  		      (const_string "0")))
     (set_attr "mode" "<MODE>")])
  
! (define_expand "vcond<mode>"
!   [(set (match_operand:VF 0 "register_operand" "")
! 	(if_then_else:VF
  	  (match_operator 3 ""
! 	    [(match_operand:VF 4 "nonimmediate_operand" "")
! 	     (match_operand:VF 5 "nonimmediate_operand" "")])
! 	  (match_operand:VF 1 "general_operand" "")
! 	  (match_operand:VF 2 "general_operand" "")))]
    "TARGET_SSE"
  {
    bool ok = ix86_expand_fp_vcond (operands);
--- 1405,1433 ----
  		      (const_string "0")))
     (set_attr "mode" "<MODE>")])
  
! (define_expand "vcond<V_256:mode><VF_256:mode>"
!   [(set (match_operand:V_256 0 "register_operand" "")
! 	(if_then_else:V_256
  	  (match_operator 3 ""
! 	    [(match_operand:VF_256 4 "nonimmediate_operand" "")
! 	     (match_operand:VF_256 5 "nonimmediate_operand" "")])
! 	  (match_operand:V_256 1 "general_operand" "")
! 	  (match_operand:V_256 2 "general_operand" "")))]
!   "TARGET_AVX"
! {
!   bool ok = ix86_expand_fp_vcond (operands);
!   gcc_assert (ok);
!   DONE;
! })
! 
! (define_expand "vcond<V_128:mode><VF_128:mode>"
!   [(set (match_operand:V_128 0 "register_operand" "")
! 	(if_then_else:V_128
! 	  (match_operator 3 ""
! 	    [(match_operand:VF_128 4 "nonimmediate_operand" "")
! 	     (match_operand:VF_128 5 "nonimmediate_operand" "")])
! 	  (match_operand:V_128 1 "general_operand" "")
! 	  (match_operand:V_128 2 "general_operand" "")))]
    "TARGET_SSE"
  {
    bool ok = ix86_expand_fp_vcond (operands);
***************
*** 6091,6104 ****
     (set_attr "prefix" "orig,vex")
     (set_attr "mode" "TI")])
  
! (define_expand "vcond<mode>"
!   [(set (match_operand:VI124_128 0 "register_operand" "")
! 	(if_then_else:VI124_128
  	  (match_operator 3 ""
  	    [(match_operand:VI124_128 4 "nonimmediate_operand" "")
  	     (match_operand:VI124_128 5 "nonimmediate_operand" "")])
! 	  (match_operand:VI124_128 1 "general_operand" "")
! 	  (match_operand:VI124_128 2 "general_operand" "")))]
    "TARGET_SSE2"
  {
    bool ok = ix86_expand_int_vcond (operands);
--- 6106,6119 ----
     (set_attr "prefix" "orig,vex")
     (set_attr "mode" "TI")])
  
! (define_expand "vcond<V_128:mode><VI124_128:mode>"
!   [(set (match_operand:V_128 0 "register_operand" "")
! 	(if_then_else:V_128
  	  (match_operator 3 ""
  	    [(match_operand:VI124_128 4 "nonimmediate_operand" "")
  	     (match_operand:VI124_128 5 "nonimmediate_operand" "")])
! 	  (match_operand:V_128 1 "general_operand" "")
! 	  (match_operand:V_128 2 "general_operand" "")))]
    "TARGET_SSE2"
  {
    bool ok = ix86_expand_int_vcond (operands);
***************
*** 6106,6119 ****
    DONE;
  })
  
! (define_expand "vcondv2di"
!   [(set (match_operand:V2DI 0 "register_operand" "")
! 	(if_then_else:V2DI
  	  (match_operator 3 ""
  	    [(match_operand:V2DI 4 "nonimmediate_operand" "")
  	     (match_operand:V2DI 5 "nonimmediate_operand" "")])
! 	  (match_operand:V2DI 1 "general_operand" "")
! 	  (match_operand:V2DI 2 "general_operand" "")))]
    "TARGET_SSE4_2"
  {
    bool ok = ix86_expand_int_vcond (operands);
--- 6121,6134 ----
    DONE;
  })
  
! (define_expand "vcond<VI8F_128:mode>v2di"
!   [(set (match_operand:VI8F_128 0 "register_operand" "")
! 	(if_then_else:VI8F_128
  	  (match_operator 3 ""
  	    [(match_operand:V2DI 4 "nonimmediate_operand" "")
  	     (match_operand:V2DI 5 "nonimmediate_operand" "")])
! 	  (match_operand:VI8F_128 1 "general_operand" "")
! 	  (match_operand:VI8F_128 2 "general_operand" "")))]
    "TARGET_SSE4_2"
  {
    bool ok = ix86_expand_int_vcond (operands);
***************
*** 6121,6134 ****
    DONE;
  })
  
! (define_expand "vcondu<mode>"
!   [(set (match_operand:VI124_128 0 "register_operand" "")
! 	(if_then_else:VI124_128
  	  (match_operator 3 ""
  	    [(match_operand:VI124_128 4 "nonimmediate_operand" "")
  	     (match_operand:VI124_128 5 "nonimmediate_operand" "")])
! 	  (match_operand:VI124_128 1 "general_operand" "")
! 	  (match_operand:VI124_128 2 "general_operand" "")))]
    "TARGET_SSE2"
  {
    bool ok = ix86_expand_int_vcond (operands);
--- 6136,6149 ----
    DONE;
  })
  
! (define_expand "vcondu<V_128:mode><VI124_128:mode>"
!   [(set (match_operand:V_128 0 "register_operand" "")
! 	(if_then_else:V_128
  	  (match_operator 3 ""
  	    [(match_operand:VI124_128 4 "nonimmediate_operand" "")
  	     (match_operand:VI124_128 5 "nonimmediate_operand" "")])
! 	  (match_operand:V_128 1 "general_operand" "")
! 	  (match_operand:V_128 2 "general_operand" "")))]
    "TARGET_SSE2"
  {
    bool ok = ix86_expand_int_vcond (operands);
***************
*** 6136,6149 ****
    DONE;
  })
  
! (define_expand "vconduv2di"
!   [(set (match_operand:V2DI 0 "register_operand" "")
! 	(if_then_else:V2DI
  	  (match_operator 3 ""
  	    [(match_operand:V2DI 4 "nonimmediate_operand" "")
  	     (match_operand:V2DI 5 "nonimmediate_operand" "")])
! 	  (match_operand:V2DI 1 "general_operand" "")
! 	  (match_operand:V2DI 2 "general_operand" "")))]
    "TARGET_SSE4_2"
  {
    bool ok = ix86_expand_int_vcond (operands);
--- 6151,6164 ----
    DONE;
  })
  
! (define_expand "vcondu<VI8F_128:mode>v2di"
!   [(set (match_operand:VI8F_128 0 "register_operand" "")
! 	(if_then_else:VI8F_128
  	  (match_operator 3 ""
  	    [(match_operand:V2DI 4 "nonimmediate_operand" "")
  	     (match_operand:V2DI 5 "nonimmediate_operand" "")])
! 	  (match_operand:VI8F_128 1 "general_operand" "")
! 	  (match_operand:VI8F_128 2 "general_operand" "")))]
    "TARGET_SSE4_2"
  {
    bool ok = ix86_expand_int_vcond (operands);
Index: trunk/gcc/config/ia64/vect.md
===================================================================
*** trunk.orig/gcc/config/ia64/vect.md	2011-02-08 12:01:06.000000000 +0100
--- trunk/gcc/config/ia64/vect.md	2011-08-29 15:56:46.000000000 +0200
***************
*** 661,667 ****
    DONE;
  })
  
! (define_expand "vcond<mode>"
    [(set (match_operand:VECINT 0 "gr_register_operand" "")
  	(if_then_else:VECINT
  	  (match_operator 3 "" 
--- 661,667 ----
    DONE;
  })
  
! (define_expand "vcond<mode><mode>"
    [(set (match_operand:VECINT 0 "gr_register_operand" "")
  	(if_then_else:VECINT
  	  (match_operator 3 "" 
***************
*** 675,681 ****
    DONE;
  })
  
! (define_expand "vcondu<mode>"
    [(set (match_operand:VECINT 0 "gr_register_operand" "")
  	(if_then_else:VECINT
  	  (match_operator 3 "" 
--- 675,681 ----
    DONE;
  })
  
! (define_expand "vcondu<mode><mode>"
    [(set (match_operand:VECINT 0 "gr_register_operand" "")
  	(if_then_else:VECINT
  	  (match_operator 3 "" 
***************
*** 1382,1388 ****
    DONE;
  })
  
! (define_expand "vcondv2sf"
    [(set (match_operand:V2SF 0 "fr_register_operand" "")
  	(if_then_else:V2SF
  	  (match_operator 3 "" 
--- 1382,1388 ----
    DONE;
  })
  
! (define_expand "vcondv2sfv2sf"
    [(set (match_operand:V2SF 0 "fr_register_operand" "")
  	(if_then_else:V2SF
  	  (match_operator 3 "" 
Index: trunk/gcc/config/mips/mips-ps-3d.md
===================================================================
*** trunk.orig/gcc/config/mips/mips-ps-3d.md	2011-01-10 12:31:19.000000000 +0100
--- trunk/gcc/config/mips/mips-ps-3d.md	2011-08-29 15:56:56.000000000 +0200
***************
*** 597,603 ****
    [(set_attr "type" "frdiv2")
     (set_attr "mode" "<UNITMODE>")])
  
! (define_expand "vcondv2sf"
    [(set (match_operand:V2SF 0 "register_operand")
  	(if_then_else:V2SF
  	  (match_operator 3 ""
--- 597,603 ----
    [(set_attr "type" "frdiv2")
     (set_attr "mode" "<UNITMODE>")])
  
! (define_expand "vcondv2sfv2sf"
    [(set (match_operand:V2SF 0 "register_operand")
  	(if_then_else:V2SF
  	  (match_operator 3 ""
Index: trunk/gcc/config/rs6000/paired.md
===================================================================
*** trunk.orig/gcc/config/rs6000/paired.md	2011-03-22 12:22:01.000000000 +0100
--- trunk/gcc/config/rs6000/paired.md	2011-08-29 15:57:01.000000000 +0200
***************
*** 507,513 ****
    DONE;
  })
  
! (define_expand "vcondv2sf"
    [(set (match_operand:V2SF 0 "gpc_reg_operand" "=f")
          (if_then_else:V2SF
           (match_operator 3 "gpc_reg_operand"
--- 507,513 ----
    DONE;
  })
  
! (define_expand "vcondv2sfv2sf"
    [(set (match_operand:V2SF 0 "gpc_reg_operand" "=f")
          (if_then_else:V2SF
           (match_operator 3 "gpc_reg_operand"
Index: trunk/gcc/config/rs6000/vector.md
===================================================================
*** trunk.orig/gcc/config/rs6000/vector.md	2011-07-11 11:49:22.000000000 +0200
--- trunk/gcc/config/rs6000/vector.md	2011-08-29 15:57:17.000000000 +0200
***************
*** 370,376 ****
  
  \f
  ;; Vector comparisons
! (define_expand "vcond<mode>"
    [(set (match_operand:VEC_F 0 "vfloat_operand" "")
  	(if_then_else:VEC_F
  	 (match_operator 3 "comparison_operator"
--- 370,376 ----
  
  \f
  ;; Vector comparisons
! (define_expand "vcond<mode><mode>"
    [(set (match_operand:VEC_F 0 "vfloat_operand" "")
  	(if_then_else:VEC_F
  	 (match_operator 3 "comparison_operator"
***************
*** 388,394 ****
      FAIL;
  }")
  
! (define_expand "vcond<mode>"
    [(set (match_operand:VEC_I 0 "vint_operand" "")
  	(if_then_else:VEC_I
  	 (match_operator 3 "comparison_operator"
--- 388,394 ----
      FAIL;
  }")
  
! (define_expand "vcond<mode><mode>"
    [(set (match_operand:VEC_I 0 "vint_operand" "")
  	(if_then_else:VEC_I
  	 (match_operator 3 "comparison_operator"
***************
*** 406,412 ****
      FAIL;
  }")
  
! (define_expand "vcondu<mode>"
    [(set (match_operand:VEC_I 0 "vint_operand" "")
  	(if_then_else:VEC_I
  	 (match_operator 3 "comparison_operator"
--- 406,412 ----
      FAIL;
  }")
  
! (define_expand "vcondu<mode><mode>"
    [(set (match_operand:VEC_I 0 "vint_operand" "")
  	(if_then_else:VEC_I
  	 (match_operator 3 "comparison_operator"
Index: trunk/gcc/config/spu/spu.md
===================================================================
*** trunk.orig/gcc/config/spu/spu.md	2011-08-04 12:59:40.000000000 +0200
--- trunk/gcc/config/spu/spu.md	2011-08-29 15:57:25.000000000 +0200
*************** selb\t%0,%4,%0,%3"
*** 3874,3880 ****
  
  \f
  ;; vector conditional compare patterns
! (define_expand "vcond<mode>"
    [(set (match_operand:VCMP 0 "spu_reg_operand" "=r")
          (if_then_else:VCMP
            (match_operator 3 "comparison_operator"
--- 3874,3880 ----
  
  \f
  ;; vector conditional compare patterns
! (define_expand "vcond<mode><mode>"
    [(set (match_operand:VCMP 0 "spu_reg_operand" "=r")
          (if_then_else:VCMP
            (match_operator 3 "comparison_operator"
*************** selb\t%0,%4,%0,%3"
*** 3891,3897 ****
      FAIL;
    })
  
! (define_expand "vcondu<mode>"
    [(set (match_operand:VCMPU 0 "spu_reg_operand" "=r")
          (if_then_else:VCMPU
            (match_operator 3 "comparison_operator"
--- 3891,3897 ----
      FAIL;
    })
  
! (define_expand "vcondu<mode><mode>"
    [(set (match_operand:VCMPU 0 "spu_reg_operand" "=r")
          (if_then_else:VCMPU
            (match_operator 3 "comparison_operator"
Index: trunk/gcc/genopinit.c
===================================================================
*** trunk.orig/gcc/genopinit.c	2011-08-19 16:26:24.000000000 +0200
--- trunk/gcc/genopinit.c	2011-08-29 15:01:06.000000000 +0200
*************** static const char * const optabs[] =
*** 253,260 ****
    "set_optab_handler (vec_shl_optab, $A, CODE_FOR_$(vec_shl_$a$))",
    "set_optab_handler (vec_shr_optab, $A, CODE_FOR_$(vec_shr_$a$))",
    "set_optab_handler (vec_realign_load_optab, $A, CODE_FOR_$(vec_realign_load_$a$))",
!   "set_direct_optab_handler (vcond_optab, $A, CODE_FOR_$(vcond$a$))",
!   "set_direct_optab_handler (vcondu_optab, $A, CODE_FOR_$(vcondu$a$))",
    "set_optab_handler (ssum_widen_optab, $A, CODE_FOR_$(widen_ssum$I$a3$))",
    "set_optab_handler (usum_widen_optab, $A, CODE_FOR_$(widen_usum$I$a3$))",
    "set_optab_handler (udot_prod_optab, $A, CODE_FOR_$(udot_prod$I$a$))",
--- 253,260 ----
    "set_optab_handler (vec_shl_optab, $A, CODE_FOR_$(vec_shl_$a$))",
    "set_optab_handler (vec_shr_optab, $A, CODE_FOR_$(vec_shr_$a$))",
    "set_optab_handler (vec_realign_load_optab, $A, CODE_FOR_$(vec_realign_load_$a$))",
!   "set_convert_optab_handler (vcond_optab, $A, $B, CODE_FOR_$(vcond$a$b$))",
!   "set_convert_optab_handler (vcondu_optab, $A, $B, CODE_FOR_$(vcondu$a$b$))",
    "set_optab_handler (ssum_widen_optab, $A, CODE_FOR_$(widen_ssum$I$a3$))",
    "set_optab_handler (usum_widen_optab, $A, CODE_FOR_$(widen_usum$I$a3$))",
    "set_optab_handler (udot_prod_optab, $A, CODE_FOR_$(udot_prod$I$a$))",
Index: trunk/gcc/optabs.c
===================================================================
*** trunk.orig/gcc/optabs.c	2011-08-29 14:58:24.000000000 +0200
--- trunk/gcc/optabs.c	2011-08-29 15:44:14.000000000 +0200
*************** vector_compare_rtx (tree cond, bool unsi
*** 6620,6646 ****
    return gen_rtx_fmt_ee (rcode, VOIDmode, ops[0].value, ops[1].value);
  }
  
! /* Return insn code for TYPE, the type of a VEC_COND_EXPR.  */
  
  static inline enum insn_code
! get_vcond_icode (tree type, enum machine_mode mode)
  {
    enum insn_code icode = CODE_FOR_nothing;
! 
!   if (TYPE_UNSIGNED (type))
!     icode = direct_optab_handler (vcondu_optab, mode);
    else
!     icode = direct_optab_handler (vcond_optab, mode);
    return icode;
  }
  
  /* Return TRUE iff, appropriate vector insns are available
!    for vector cond expr with type TYPE in VMODE mode.  */
  
  bool
! expand_vec_cond_expr_p (tree type, enum machine_mode vmode)
  {
!   if (get_vcond_icode (type, vmode) == CODE_FOR_nothing)
      return false;
    return true;
  }
--- 6620,6648 ----
    return gen_rtx_fmt_ee (rcode, VOIDmode, ops[0].value, ops[1].value);
  }
  
! /* Return insn code for a conditional operator with a comparison in
!    mode CMODE, unsigned if UNS is true, resulting in a value of mode VMODE.  */
  
  static inline enum insn_code
! get_vcond_icode (enum machine_mode vmode, enum machine_mode cmode, bool uns)
  {
    enum insn_code icode = CODE_FOR_nothing;
!   if (uns)
!     icode = convert_optab_handler (vcondu_optab, vmode, cmode);
    else
!     icode = convert_optab_handler (vcond_optab, vmode, cmode);
    return icode;
  }
  
  /* Return TRUE iff, appropriate vector insns are available
!    for vector cond expr with vector type VALUE_TYPE and a comparison
!    with operand vector types in CMP_OP_TYPE.  */
  
  bool
! expand_vec_cond_expr_p (tree value_type, tree cmp_op_type)
  {
!   if (get_vcond_icode (TYPE_MODE (value_type), TYPE_MODE (cmp_op_type),
! 		       TYPE_UNSIGNED (cmp_op_type)) == CODE_FOR_nothing)
      return false;
    return true;
  }
*************** expand_vec_cond_expr (tree vec_cond_type
*** 6656,6664 ****
    enum insn_code icode;
    rtx comparison, rtx_op1, rtx_op2;
    enum machine_mode mode = TYPE_MODE (vec_cond_type);
!   bool unsignedp = TYPE_UNSIGNED (vec_cond_type);
! 
!   icode = get_vcond_icode (vec_cond_type, mode);
    if (icode == CODE_FOR_nothing)
      return 0;
  
--- 6658,6670 ----
    enum insn_code icode;
    rtx comparison, rtx_op1, rtx_op2;
    enum machine_mode mode = TYPE_MODE (vec_cond_type);
!   bool unsignedp;
!   
!   gcc_assert (COMPARISON_CLASS_P (op0));
! 
!   unsignedp = TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0)));
!   icode = get_vcond_icode (mode, TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0, 0))),
! 			   unsignedp);
    if (icode == CODE_FOR_nothing)
      return 0;
  
Index: trunk/gcc/optabs.h
===================================================================
*** trunk.orig/gcc/optabs.h	2011-08-19 16:26:24.000000000 +0200
--- trunk/gcc/optabs.h	2011-08-29 15:35:54.000000000 +0200
*************** enum convert_optab_index
*** 589,594 ****
--- 589,598 ----
    COI_vec_load_lanes,
    COI_vec_store_lanes,
  
+   /* Vector conditional operations.  */
+   COI_vcond,
+   COI_vcondu,
+ 
    COI_MAX
  };
  
*************** enum convert_optab_index
*** 611,616 ****
--- 615,622 ----
  #define satfractuns_optab (&convert_optab_table[COI_satfractuns])
  #define vec_load_lanes_optab (&convert_optab_table[COI_vec_load_lanes])
  #define vec_store_lanes_optab (&convert_optab_table[COI_vec_store_lanes])
+ #define vcond_optab (&convert_optab_table[(int) COI_vcond])
+ #define vcondu_optab (&convert_optab_table[(int) COI_vcondu])
  
  /* Contains the optab used for each rtx code.  */
  extern optab code_to_optab[NUM_RTX_CODE + 1];
*************** enum direct_optab_index
*** 632,641 ****
    DOI_reload_in,
    DOI_reload_out,
  
-   /* Vector conditional operations.  */
-   DOI_vcond,
-   DOI_vcondu,
- 
    /* Block move operation.  */
    DOI_movmem,
  
--- 638,643 ----
*************** typedef struct direct_optab_d *direct_op
*** 699,706 ****
  #endif
  #define reload_in_optab (&direct_optab_table[(int) DOI_reload_in])
  #define reload_out_optab (&direct_optab_table[(int) DOI_reload_out])
- #define vcond_optab (&direct_optab_table[(int) DOI_vcond])
- #define vcondu_optab (&direct_optab_table[(int) DOI_vcondu])
  #define movmem_optab (&direct_optab_table[(int) DOI_movmem])
  #define setmem_optab (&direct_optab_table[(int) DOI_setmem])
  #define cmpstr_optab (&direct_optab_table[(int) DOI_cmpstr])
--- 701,706 ----
*************** extern bool expand_sfix_optab (rtx, rtx,
*** 877,883 ****
  extern rtx expand_widening_mult (enum machine_mode, rtx, rtx, rtx, int, optab);
  
  /* Return tree if target supports vector operations for COND_EXPR.  */
! bool expand_vec_cond_expr_p (tree, enum machine_mode);
  
  /* Generate code for VEC_COND_EXPR.  */
  extern rtx expand_vec_cond_expr (tree, tree, tree, tree, rtx);
--- 877,883 ----
  extern rtx expand_widening_mult (enum machine_mode, rtx, rtx, rtx, int, optab);
  
  /* Return tree if target supports vector operations for COND_EXPR.  */
! bool expand_vec_cond_expr_p (tree, tree);
  
  /* Generate code for VEC_COND_EXPR.  */
  extern rtx expand_vec_cond_expr (tree, tree, tree, tree, rtx);
Index: trunk/gcc/tree-vect-stmts.c
===================================================================
*** trunk.orig/gcc/tree-vect-stmts.c	2011-08-29 14:58:24.000000000 +0200
--- trunk/gcc/tree-vect-stmts.c	2011-08-29 15:06:48.000000000 +0200
*************** vectorizable_condition (gimple stmt, gim
*** 4749,4755 ****
    tree vec_compare, vec_cond_expr;
    tree new_temp;
    loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
-   enum machine_mode vec_mode;
    tree def;
    enum vect_def_type dt, dts[4];
    int nunits = TYPE_VECTOR_SUBPARTS (vectype);
--- 4749,4754 ----
*************** vectorizable_condition (gimple stmt, gim
*** 4833,4845 ****
  	   && TREE_CODE (else_clause) != FIXED_CST)
      return false;
  
- 
-   vec_mode = TYPE_MODE (vectype);
- 
    if (!vec_stmt)
      {
        STMT_VINFO_TYPE (stmt_info) = condition_vec_info_type;
!       return expand_vec_cond_expr_p (TREE_TYPE (op), vec_mode);
      }
  
    /* Transform */
--- 4832,4841 ----
  	   && TREE_CODE (else_clause) != FIXED_CST)
      return false;
  
    if (!vec_stmt)
      {
        STMT_VINFO_TYPE (stmt_info) = condition_vec_info_type;
!       return expand_vec_cond_expr_p (vectype, vectype);
      }
  
    /* Transform */

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-09-02 12:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-29 15:08 [PATCH] Change vcond<mode> to vcond<mode1><mode2> Richard Guenther
2011-08-29 16:36 ` Richard Guenther
2011-08-29 20:47 ` Uros Bizjak
2011-08-29 21:05   ` Richard Guenther
2011-08-30  9:00     ` Uros Bizjak
2011-08-30  9:19       ` Richard Guenther
2011-08-30  9:24         ` Uros Bizjak
2011-08-30  9:29           ` Jakub Jelinek
2011-08-30  9:39             ` Richard Guenther
2011-08-30  9:42             ` Uros Bizjak
2011-08-30 10:17               ` Richard Guenther
2011-08-30 10:48                 ` Uros Bizjak
2011-08-30 11:59                   ` Richard Guenther
2011-08-30 12:11                     ` Richard Guenther
2011-09-02  9:44                       ` Richard Guenther
2011-09-02 12:19                         ` Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).