]>
git.ipfire.org Git - thirdparty/gcc.git/commit
Add helpers to test whether an optab can be implemented
The vectoriser and vector lowering passes both had tests of the form:
if (op
&& (optab_handler (op, compute_mode) != CODE_FOR_nothing
|| optab_libfunc (op, compute_mode)))
...success...
if (code == MULT_HIGHPART_EXPR
&& can_mult_highpart_p (compute_mode,
TYPE_UNSIGNED (compute_type)))
...success...
This patch adds helper routines for this kind of test, so that it's
easier to handle other optab alternatives in a similar way.
gcc/
* optabs-query.cc (can_open_code_p, can_implement_p): Declare.
* optabs-query.h (can_open_code_p, can_implement_p): New functions.
* optabs-tree.cc (target_supports_op_p): Use can_implement_p.
* tree-vect-stmts.cc (vectorizable_operation): Likewise.
* tree-vect-generic.cc (get_compute_type): Likewise. Remove code
parameter.
(expand_vector_scalar_condition, expand_vector_conversion)
(expand_vector_operations_1): Update calls accordingly.