}
}
-/* Expand a vcond or vcondu pattern with operands OPERANDS.
- CMP_RESULT_MODE is the mode of the comparison result. */
-
-void
-arm_expand_vcond (rtx *operands, machine_mode cmp_result_mode)
-{
- /* When expanding for MVE, we do not want to emit a (useless) vpsel in
- arm_expand_vector_compare, and another one here. */
- rtx mask;
-
- if (TARGET_HAVE_MVE)
- mask = gen_reg_rtx (arm_mode_to_pred_mode (cmp_result_mode).require ());
- else
- mask = gen_reg_rtx (cmp_result_mode);
-
- bool inverted = arm_expand_vector_compare (mask, GET_CODE (operands[3]),
- operands[4], operands[5], true);
- if (inverted)
- std::swap (operands[1], operands[2]);
- if (TARGET_NEON)
- emit_insn (gen_neon_vbsl (GET_MODE (operands[0]), operands[0],
- mask, operands[1], operands[2]));
- else
- {
- machine_mode cmp_mode = GET_MODE (operands[0]);
-
- switch (GET_MODE_CLASS (cmp_mode))
- {
- case MODE_VECTOR_INT:
- emit_insn (gen_mve_q (VPSELQ_S, VPSELQ_S, cmp_mode, operands[0],
- operands[1], operands[2], mask));
- break;
- case MODE_VECTOR_FLOAT:
- if (TARGET_HAVE_MVE_FLOAT)
- emit_insn (gen_mve_q_f (VPSELQ_F, cmp_mode, operands[0],
- operands[1], operands[2], mask));
- else
- gcc_unreachable ();
- break;
- default:
- gcc_unreachable ();
- }
- }
-}
\f
#define MAX_VECT_LEN 16
}
})
-;; Conditional instructions. These are comparisons with conditional moves for
-;; vectors. They perform the assignment:
-;;
-;; Vop0 = (Vop4 <op3> Vop5) ? Vop1 : Vop2;
-;;
-;; where op3 is <, <=, ==, !=, >= or >. Operations are performed
-;; element-wise.
-
-(define_expand "vcond<mode><mode>"
- [(set (match_operand:VDQWH 0 "s_register_operand")
- (if_then_else:VDQWH
- (match_operator 3 "comparison_operator"
- [(match_operand:VDQWH 4 "s_register_operand")
- (match_operand:VDQWH 5 "reg_or_zero_operand")])
- (match_operand:VDQWH 1 "s_register_operand")
- (match_operand:VDQWH 2 "s_register_operand")))]
- "ARM_HAVE_<MODE>_ARITH
- && !TARGET_REALLY_IWMMXT
- && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
-{
- arm_expand_vcond (operands, <V_cmp_result>mode);
- DONE;
-})
-
-(define_expand "vcond<V_cvtto><mode>"
- [(set (match_operand:<V_CVTTO> 0 "s_register_operand")
- (if_then_else:<V_CVTTO>
- (match_operator 3 "comparison_operator"
- [(match_operand:V32 4 "s_register_operand")
- (match_operand:V32 5 "reg_or_zero_operand")])
- (match_operand:<V_CVTTO> 1 "s_register_operand")
- (match_operand:<V_CVTTO> 2 "s_register_operand")))]
- "ARM_HAVE_<MODE>_ARITH
- && !TARGET_REALLY_IWMMXT
- && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
-{
- arm_expand_vcond (operands, <V_cmp_result>mode);
- DONE;
-})
-
-(define_expand "vcond<VH_cvtto><mode>"
- [(set (match_operand:<VH_CVTTO> 0 "s_register_operand")
- (if_then_else:<VH_CVTTO>
- (match_operator 3 "comparison_operator"
- [(match_operand:V16 4 "s_register_operand")
- (match_operand:V16 5 "reg_or_zero_operand")])
- (match_operand:<VH_CVTTO> 1 "s_register_operand")
- (match_operand:<VH_CVTTO> 2 "s_register_operand")))]
- "ARM_HAVE_<MODE>_ARITH
- && !TARGET_REALLY_IWMMXT
- && (!<Is_float_mode> || flag_unsafe_math_optimizations)"
-{
- arm_expand_vcond (operands, <V_cmp_result>mode);
- DONE;
-})
-
-(define_expand "vcondu<mode><v_cmp_result>"
- [(set (match_operand:VDQW 0 "s_register_operand")
- (if_then_else:VDQW
- (match_operator 3 "arm_comparison_operator"
- [(match_operand:<V_cmp_result> 4 "s_register_operand")
- (match_operand:<V_cmp_result> 5 "reg_or_zero_operand")])
- (match_operand:VDQW 1 "s_register_operand")
- (match_operand:VDQW 2 "s_register_operand")))]
- "ARM_HAVE_<MODE>_ARITH
- && !TARGET_REALLY_IWMMXT"
-{
- arm_expand_vcond (operands, <V_cmp_result>mode);
- DONE;
-})
-
(define_expand "vec_load_lanesoi<mode>"
[(set (match_operand:OI 0 "s_register_operand")
(unspec:OI [(match_operand:OI 1 "neon_struct_operand")