Skip to content
Snippets Groups Projects
Commit e29dd0eb authored by Richard Sandiford's avatar Richard Sandiford
Browse files

vect: Allow vconds between different vector sizes

The vcond code requires the compared vectors and the selected
vectors to have both the same size and the same number of elements
as each other.  But the operation makes logical sense even for
different vector sizes.  E.g. you could compare two V4SIs and
use the result to select between two V4DIs.

The underlying optab already allows the compared mode and the selected
mode to be specified separately.  Since the vectoriser now also
supports mixed vector sizes, I think we can simply remove the
equal-size check and just keep the equal-lanes check.  It's then
up to the target to decide which (if any) mixtures of sizes it
supports.

gcc/
	* optabs-tree.c (expand_vec_cond_expr_p): Allow the compared values
	and the selected values to have different mode sizes.
	* gimple-isel.cc (gimple_expand_vec_cond_expr): Likewise.
parent 0ebaea3b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment