})
\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"
- [(match_operand:VEC_F 4 "vfloat_operand")
- (match_operand:VEC_F 5 "vfloat_operand")])
- (match_operand:VEC_F 1 "vfloat_operand")
- (match_operand:VEC_F 2 "vfloat_operand")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
-(define_expand "vcond<mode><mode>"
- [(set (match_operand:VEC_I 0 "vint_operand")
- (if_then_else:VEC_I
- (match_operator 3 "comparison_operator"
- [(match_operand:VEC_I 4 "vint_operand")
- (match_operand:VEC_I 5 "vint_operand")])
- (match_operand:VEC_I 1 "vector_int_reg_or_same_bit")
- (match_operand:VEC_I 2 "vector_int_reg_or_same_bit")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
-(define_expand "vcondv4sfv4si"
- [(set (match_operand:V4SF 0 "vfloat_operand")
- (if_then_else:V4SF
- (match_operator 3 "comparison_operator"
- [(match_operand:V4SI 4 "vint_operand")
- (match_operand:V4SI 5 "vint_operand")])
- (match_operand:V4SF 1 "vfloat_operand")
- (match_operand:V4SF 2 "vfloat_operand")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)
- && VECTOR_UNIT_ALTIVEC_P (V4SImode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
-(define_expand "vcondv4siv4sf"
- [(set (match_operand:V4SI 0 "vint_operand")
- (if_then_else:V4SI
- (match_operator 3 "comparison_operator"
- [(match_operand:V4SF 4 "vfloat_operand")
- (match_operand:V4SF 5 "vfloat_operand")])
- (match_operand:V4SI 1 "vint_operand")
- (match_operand:V4SI 2 "vint_operand")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)
- && VECTOR_UNIT_ALTIVEC_P (V4SImode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
-(define_expand "vcondv2dfv2di"
- [(set (match_operand:V2DF 0 "vfloat_operand")
- (if_then_else:V2DF
- (match_operator 3 "comparison_operator"
- [(match_operand:V2DI 4 "vint_operand")
- (match_operand:V2DI 5 "vint_operand")])
- (match_operand:V2DF 1 "vfloat_operand")
- (match_operand:V2DF 2 "vfloat_operand")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DFmode)
- && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DImode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
-(define_expand "vcondv2div2df"
- [(set (match_operand:V2DI 0 "vint_operand")
- (if_then_else:V2DI
- (match_operator 3 "comparison_operator"
- [(match_operand:V2DF 4 "vfloat_operand")
- (match_operand:V2DF 5 "vfloat_operand")])
- (match_operand:V2DI 1 "vint_operand")
- (match_operand:V2DI 2 "vint_operand")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DFmode)
- && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DImode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
-(define_expand "vcondu<mode><mode>"
- [(set (match_operand:VEC_I 0 "vint_operand")
- (if_then_else:VEC_I
- (match_operator 3 "comparison_operator"
- [(match_operand:VEC_I 4 "vint_operand")
- (match_operand:VEC_I 5 "vint_operand")])
- (match_operand:VEC_I 1 "vector_int_reg_or_same_bit")
- (match_operand:VEC_I 2 "vector_int_reg_or_same_bit")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
-(define_expand "vconduv4sfv4si"
- [(set (match_operand:V4SF 0 "vfloat_operand")
- (if_then_else:V4SF
- (match_operator 3 "comparison_operator"
- [(match_operand:V4SI 4 "vint_operand")
- (match_operand:V4SI 5 "vint_operand")])
- (match_operand:V4SF 1 "vfloat_operand")
- (match_operand:V4SF 2 "vfloat_operand")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)
- && VECTOR_UNIT_ALTIVEC_P (V4SImode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
-(define_expand "vconduv2dfv2di"
- [(set (match_operand:V2DF 0 "vfloat_operand")
- (if_then_else:V2DF
- (match_operator 3 "comparison_operator"
- [(match_operand:V2DI 4 "vint_operand")
- (match_operand:V2DI 5 "vint_operand")])
- (match_operand:V2DF 1 "vfloat_operand")
- (match_operand:V2DF 2 "vfloat_operand")))]
- "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DFmode)
- && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V2DImode)"
-{
- if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
- operands[3], operands[4], operands[5]))
- DONE;
- else
- gcc_unreachable ();
-})
-
;; To support vector condition vectorization, define vcond_mask and vec_cmp.
;; Same mode for condition true/false values and predicate operand.