This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Add pre-AVX2 support for (i32 bitcast(v32i1)) -> 2xMOVMSK
ClosedPublic

Authored by RKSimon on Jul 12 2017, 6:27 AM.

Details

Summary

Currently we only support (i32 bitcast(v32i1)) using the AVX2 VPMOVMSKB ymm instruction.

This patch adds support for splitting pre-AVX2 targets into 2 x (V)PMOVMSKB xmm instructions and merging the integer results.

In future we could probably generalize this to handle more cases.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Jul 12 2017, 6:27 AM
filcab added inline comments.Jul 12 2017, 6:59 AM
lib/Target/X86/X86ISelLowering.cpp
29284 ↗(On Diff #106193)

Suggestion: We can probably split the else if, as I think it makes it easy to miss that the block above already returned. What do you think about:

if (SextVT == MVT::v32i8 && ...) {
  //...
  return ...
}

if (SExtVT == MVT::v8i16) {
  ...
RKSimon updated this revision to Diff 106210.Jul 12 2017, 7:38 AM

@filcab Split up if-else chain

@zvi Any comments?

zvi edited edge metadata.Jul 20 2017, 12:24 PM

Simon, I apologize for the delayed response. Will review ASAP.

zvi added a comment.Jul 20 2017, 12:33 PM

LGTM. Thanks!

zvi accepted this revision.Jul 20 2017, 12:33 PM
This revision is now accepted and ready to land.Jul 20 2017, 12:33 PM
This revision was automatically updated to reflect the committed changes.