Refactor expand_vec_perm
commit75051be3ec7d6be48e699cedaf756578bf57e766
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Jan 2018 18:26:16 +0000 (2 18:26 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Jan 2018 18:26:16 +0000 (2 18:26 +0000)
tree93129a39bf65aef7a97f30ca8329f00826514d79
parent97f7d65ee246e75f1ac0039d5bdae85c6fd2f635
Refactor expand_vec_perm

This patch splits the variable handling out of expand_vec_perm into
a subroutine, so that the next patch can use a different interface
for expanding constant permutes.  expand_vec_perm now does all the
CONST_VECTOR handling directly and defers to expand_vec_perm_var
for other rtx codes.  Handling CONST_VECTORs includes handling the
fallback to variable permutes.

The patch also adds an assert for valid optab modes to expand_vec_perm_1,
so that we get it when using optabs for CONST_VECTORs.  The MODE_VECTOR_INT
part was previously in expand_vec_perm and the mode_for_int_vector part
is new.

Most of the patch is just reindentation.

2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* optabs.c (expand_vec_perm_1): Assert that SEL has an integer
vector mode and that that mode matches the mode of the data
being permuted.
(expand_vec_perm): Split handling of non-CONST_VECTOR selectors
out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
directly using expand_vec_perm_1 when forcing selectors into
registers.
(expand_vec_perm_var): New function, split out from expand_vec_perm.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256092 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/optabs.c