return convert_optab_handler (vec_cmpeq_optab, vmode, mask_mode);
}
-/* 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. */
-
-inline enum insn_code
-get_vcond_icode (machine_mode vmode, 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 insn code for a conditional operator with a mask mode
MMODE resulting in a value of mode VMODE. */
return convert_optab_handler (vcond_mask_optab, vmode, mmode);
}
-/* Return insn code for a conditional operator with a comparison in
- mode CMODE (only EQ/NE), resulting in a value of mode VMODE. */
-
-inline enum insn_code
-get_vcond_eq_icode (machine_mode vmode, machine_mode cmode)
-{
- return convert_optab_handler (vcondeq_optab, vmode, cmode);
-}
-
/* Enumerates the possible extraction_insn operations. */
enum extraction_pattern { EP_insv, EP_extv, EP_extzv };
|| vec_cmp_eq_icode_p (value_type, mask_type, code);
}
-/* Return true iff vcond_optab/vcondu_optab can handle a vector
- comparison for code CODE, comparing operands of type CMP_OP_TYPE and
- producing a result of type VALUE_TYPE. */
-
-static bool
-vcond_icode_p (tree value_type, tree cmp_op_type, enum tree_code code)
-{
- enum rtx_code rcode = get_rtx_code_1 (code, TYPE_UNSIGNED (cmp_op_type));
- if (rcode == UNKNOWN)
- return false;
-
- return can_vcond_compare_p (rcode, TYPE_MODE (value_type),
- TYPE_MODE (cmp_op_type));
-}
-
-/* Return true iff vcondeq_optab can handle a vector comparison for code CODE,
- comparing operands of type CMP_OP_TYPE and producing a result of type
- VALUE_TYPE. */
-
-static bool
-vcond_eq_icode_p (tree value_type, tree cmp_op_type, enum tree_code code)
-{
- if (code != EQ_EXPR && code != NE_EXPR)
- return false;
-
- return get_vcond_eq_icode (TYPE_MODE (value_type), TYPE_MODE (cmp_op_type))
- != CODE_FOR_nothing;
-}
-
/* 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, enum tree_code code)
+expand_vec_cond_expr_p (tree value_type, tree cmp_op_type)
{
- machine_mode value_mode = TYPE_MODE (value_type);
- machine_mode cmp_op_mode = TYPE_MODE (cmp_op_type);
if (VECTOR_BOOLEAN_TYPE_P (cmp_op_type)
&& get_vcond_mask_icode (TYPE_MODE (value_type),
TYPE_MODE (cmp_op_type)) != CODE_FOR_nothing)
return true;
- if (maybe_ne (GET_MODE_NUNITS (value_mode), GET_MODE_NUNITS (cmp_op_mode)))
- return false;
-
- if (TREE_CODE_CLASS (code) != tcc_comparison)
- /* This may happen, for example, if code == SSA_NAME, in which case we
- cannot be certain whether a vector insn is available. */
- return false;
-
- return vcond_icode_p (value_type, cmp_op_type, code)
- || vcond_eq_icode_p (value_type, cmp_op_type, code);
+ return false;
}
/* Use the current target and options to initialize
bool supportable_convert_operation (enum tree_code, tree, tree,
enum tree_code *);
bool expand_vec_cmp_expr_p (tree, tree, enum tree_code);
-bool expand_vec_cond_expr_p (tree, tree, enum tree_code = ERROR_MARK);
+bool expand_vec_cond_expr_p (tree, tree);
void init_tree_optimization_optabs (tree);
bool target_supports_op_p (tree, enum tree_code,
enum optab_subtype = optab_default);
return insn_predicate_matches_p (icode, 1, code, mask_mode, value_mode);
}
-/* Return whether the backend can emit a vector comparison (vcond/vcondu) for
- code CODE, comparing operands of mode CMP_OP_MODE and producing a result
- with VALUE_MODE. */
-
-bool
-can_vcond_compare_p (enum rtx_code code, machine_mode value_mode,
- machine_mode cmp_op_mode)
-{
- enum insn_code icode
- = get_vcond_icode (value_mode, cmp_op_mode, unsigned_optab_p (code));
- if (icode == CODE_FOR_nothing)
- return false;
-
- return insn_predicate_matches_p (icode, 3, code, value_mode, cmp_op_mode);
-}
-
/* Return whether the backend can emit vector set instructions for inserting
element into vector at variable index position. */
with MASK_MODE. */
extern bool can_vec_cmp_compare_p (enum rtx_code, machine_mode, machine_mode);
-/* Return whether the backend can emit a vector comparison (vcond/vcondu) for
- code CODE, comparing operands of mode CMP_OP_MODE and producing a result
- with VALUE_MODE. */
-extern bool can_vcond_compare_p (enum rtx_code, machine_mode, machine_mode);
-
/* Return whether the backend can emit vector set instructions for inserting
element into vector at variable index position. */
extern bool can_vec_set_var_idx_p (machine_mode);