This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use native shuffle vector for the perm2f128 intrinsics
ClosedPublic

Authored by craig.topper on Sep 14 2017, 11:36 PM.

Details

Summary

This patch replaces the perm2f128 intrinsics with native shuffle vectors.

This uses a pretty simple approach to allocate source 0 to the lower half input and source 1 to the upper half input. Then its just a matter of filling in the indices to use either the lower or upper half of that specific source. This can result in the same source being used by both operands. InstCombine or SelectionDAGBuilder should be able to clean that up.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Sep 14 2017, 11:36 PM
craig.topper edited subscribers, added: cfe-commits; removed: llvm-commits.Sep 14 2017, 11:39 PM
RKSimon edited edge metadata.Sep 15 2017, 1:30 AM

_mm256_permute2x128_si256 ?

Also, there currently isn't any testing of the zero vector case.

Convert the AVX2 integer intrinsic as well.

RKSimon accepted this revision.Sep 15 2017, 11:24 AM

LGTM - please can you update the avx-intrinsics-fast-isel.ll/avxs-intrinsics-fast-isel.ll cases to match the *-builtins.c as well (either now or if/when you add the intrinsics to autoupgrade).

This revision is now accepted and ready to land.Sep 15 2017, 11:24 AM
This revision was automatically updated to reflect the committed changes.