This is an archive of the discontinued LLVM Phabricator instance.

[Power9]Legalize and emit code for truncate and convert Quad-Precision to Double-Word
ClosedPublic

Authored by lei on Apr 11 2018, 8:25 PM.

Details

Summary

Legalize and emit code for:

  • xscvqpsdz : VSX Scalar truncate & Convert Quad-Precision to Signed Dword
  • xscvqpudz : VSX Scalar truncate & Convert Quad-Precision to Unsigned Dword

Diff Detail

Event Timeline

lei created this revision.Apr 11 2018, 8:25 PM
inouehrs added inline comments.
lib/Target/PowerPC/PPCISelLowering.cpp
9417

I feel it is better to do this check in LowerFP_TO_INT for ease of reading.

lei updated this revision to Diff 142237.Apr 12 2018, 12:57 PM

update as per review comment.

lei marked an inline comment as done.Apr 12 2018, 12:58 PM
lei updated this revision to Diff 142249.Apr 12 2018, 1:25 PM
nemanjai requested changes to this revision.Apr 17 2018, 5:47 PM
nemanjai added inline comments.
lib/Target/PowerPC/PPCISelLowering.cpp
6928

This sentence makes it sound like this is legal in a judicial sense. Perhaps:
// FP to INT conversions are legal for f128.

lib/Target/PowerPC/PPCInstrVSX.td
3157

Don't forget periods on comments.

3158

This seems very wrong. The STXSD will need a reg and an immediate and xoaddr will force it to use reg+reg. We should have two versions here (xaddr -> STXSDX and ixaddr -> STXSD). And we should also have test cases for both store instructions.

test/CodeGen/PowerPC/f128-truncateNconv.ll
2

Don't forget -verify-machineinstrs in test cases. We want to make sure we don't introduce new machine verifier failures (which I think this patch does).

This revision now requires changes to proceed.Apr 17 2018, 5:47 PM
lei updated this revision to Diff 143109.Apr 19 2018, 9:41 AM
lei marked 2 inline comments as done.

address review comments.

lei marked 2 inline comments as done.Apr 19 2018, 9:41 AM
lei updated this revision to Diff 144061.Apr 25 2018, 10:20 PM
nemanjai accepted this revision.May 1 2018, 7:37 AM

LGTM. Of course, after the dependent patch lands.

This revision is now accepted and ready to land.May 1 2018, 7:37 AM
This revision was automatically updated to reflect the committed changes.