Support vec-perm for NEON

Registered by Ira Rosen

VEC_PERM_EXPR is used for general permutation of vector elements. The vectorizer generates VEC_PERM_EXPR in two cases: for load permutation in SLP and for backward accesses. We cover the first case with vldN. The second case only requires to revert the order of vector elements, which is a much easier task.

Implementing general permutation and using it for backward accesses may not be the most efficient solution. It may be better to introduce a new optab for vector revert and use it in the vectorizer for such cases. Another option is to generate a vtbl.8 in the most generic permute case, and split the reverse case into a special case using the mask to differentiate between the cases. To implement reverse we can use vrev followed by vswp or just a vrev depending on the number of bits in the vectors under consideration.

We already have a BSWAP operation on RTL .

This will help vectorize libav dcadsp.c: ff_dca_lfe_fir().

Another case libav fdct (will require some support in SLP):

    tmp0 = dataptr[0] + dataptr[7];
    tmp1 = dataptr[1] + dataptr[6];
    tmp2 = dataptr[2] + dataptr[5];
    tmp3 = dataptr[3] + dataptr[4];

    tmp7 = dataptr[0] - dataptr[7];
    tmp6 = dataptr[1] - dataptr[6];
    tmp5 = dataptr[2] - dataptr[5];
    tmp4 = dataptr[3] - dataptr[4];

Blueprint information

Status:
Complete
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Approved
Assignee:
None
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
milestone icon backlog
Started by
Michael Hope
Completed by
Michael Hope

Related branches

Sprints

Whiteboard

Covered by other upstream work in Jan.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.