Page MenuHomePhabricator

[ARM] Match VABDL from log2 shuffles.
ClosedPublic

Authored by chatur01 on Nov 13 2015, 10:42 AM.

Details

Summary

The patterns are pretty gross, but I couldn't see a more concise way of doing it.

The bitcasts are needed for the v2i64 and v8i16 cases because they're type-legalized to v4i32.

Diff Detail

Repository
rL LLVM

Event Timeline

chatur01 retitled this revision from to [ARM] Match VABDL from log2 shuffles..
chatur01 updated this object.
chatur01 added reviewers: jmolloy, rengolin.
chatur01 set the repository for this revision to rL LLVM.
chatur01 added a subscriber: llvm-commits.
chatur01 removed rL LLVM as the repository for this revision.

Made the patterns a bit nicer with the help of a PatFrag

rengolin edited edge metadata.EditedNov 16 2015, 10:36 AM

Hi Charlie,

It seems that this pattern is only valid if the original types were unsigned to begin with, which is a fair assumption, but Is there any guarantee that the zero-extend is exclusively used in unsigned values, or are there some legalization patterns that could zero extend for other reasons?

For instance, this arithmetic shift-right is used instead of logical, in assumed unsigned values, because negative numbers will set the most significant bits of the double-size result registers, and you want to clear them out with the XOR.

Funny, though, it also works when both values are negative, but not when they're of different signs, because you end up with a FF00 or 00FF pattern in the intermediate results.

cheers,
--renato

rengolin accepted this revision.Nov 16 2015, 12:40 PM
rengolin edited edge metadata.
This revision is now accepted and ready to land.Nov 16 2015, 12:40 PM
This revision was automatically updated to reflect the committed changes.