This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Keep vector int to fp conversions in vector domain
ClosedPublic

Authored by RolandF on Oct 16 2018, 4:09 PM.

Details

Summary

At present a v2i16 -> v2f64 convert is implemented by extracts to scalar, scalar converts, and merge back into a vector. Use vector converts instead, with the int data permuted into the proper position and extended if necessary.

Diff Detail

Repository
rL LLVM

Event Timeline

RolandF created this revision.Oct 16 2018, 4:09 PM
nemanjai set the repository for this revision to rL LLVM.
nemanjai added inline comments.Oct 19 2018, 5:29 AM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
7276 ↗(On Diff #169905)

I think more appropriate names to illustrate how these are being used are something like:
WideNum -> WideNumElts
SourceNum -> NumConcat
Sources -> Ops or Sources -> ConcatSources

7310 ↗(On Diff #169905)

This works for LE, but not for BE. You should probably change it to something like:

if (Subtarget.isLittleEndian()) {
  ShuffV[0] = 0;
  ShuffV[WideNum / 2] = 1;
} else {
  ShuffV[WideNum / 2 - 1] = 0;
  ShuffV[WideNum - 1] = 1;
}

And add a big endian run line to the test case.

RolandF updated this revision to Diff 170679.Oct 23 2018, 9:29 AM

Address review comments - change variable names, support/test big-endian.

nemanjai accepted this revision.Oct 23 2018, 10:27 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Oct 23 2018, 10:27 AM
This revision was automatically updated to reflect the committed changes.