This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Support constrained fp operation for scalar sitofp/uitofp

Authored by qiucf on Jun 11 2020, 9:47 AM.



This patch adds support for constrained conversion operation (uitofp/sitofp) on PowerPC.

Diff Detail

Event Timeline

qiucf created this revision.Jun 11 2020, 9:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 11 2020, 9:47 AM
steven.zhang added inline comments.Jun 14 2020, 6:49 PM

You don't need to have two overloaded functions, but with one to have an array of ops.


Add a run with fp128 enabled.


How about the f128/ppc_fp128 -> i128 ?

qiucf updated this revision to Diff 270661.Jun 14 2020, 10:31 PM

Rebase after D81818 and add f128 support.

qiucf updated this revision to Diff 274024.Jun 29 2020, 2:42 AM

Update to reflect changes in D81537.

qiucf updated this revision to Diff 278705.Jul 17 2020, 3:14 AM

Reflect changes after strict conversion for SPE and enable-ppc-quad-precision's removal.

qiucf updated this revision to Diff 280772.Jul 26 2020, 8:25 PM

Fix an opcode check bug.

steven.zhang accepted this revision.Aug 2 2020, 7:05 PM

LGTM. But please hold on for some days to see there is other concern.

This revision is now accepted and ready to land.Aug 2 2020, 7:05 PM
qiucf updated this revision to Diff 286734.Aug 20 2020, 1:25 AM
qiucf edited the summary of this revision. (Show Details)

Adjust load/store chain when direct move is not available

A few comments inline, otherwise this looks good.


Shouldn't you pass an empty chain to convertIntToFP for non-strict operations?
Or else, given that you pass the full Op, I guess convertIntToFP can retrieve the chain itself?


Is there any reason for not just matching them in the original patterns via PPCany_... operators like elsewhere? Also, need to verify the mayRaiseFPException flags for those patterns.


Same comment as above.

qiucf updated this revision to Diff 286944.Aug 20 2020, 8:20 PM
qiucf marked 3 inline comments as done.
  • Use PPCany_* to restructure tblgen file
  • Add mayRaiseFPException flag to fcfid*
  • Add default argument to convertIntToFp

Thanks for patient comments!

uweigand accepted this revision.Aug 21 2020, 5:03 AM

OK, this now looks all good to me as well. Thanks!

This revision was automatically updated to reflect the committed changes.