This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Implement ISD::BITCAST for fp128 -> i128.
ClosedPublic

Authored by jonpa on Sep 23 2021, 10:02 AM.

Details

Summary

The type legalizer has by default no method of doing this bitcast other than storing and reloading the value from stack.

This patch implements a custom lowering of this operation using extractions of subregs (z13 and earlier using FP128 register pairs), or of vector elements (with vector enhancements-1 using VR128 FP registers).

(Unfortunately there is no "low" subreg for a VR128 reg, so that case had to get its own separate handling.)

Diff Detail

Event Timeline

jonpa created this revision.Sep 23 2021, 10:02 AM
jonpa requested review of this revision.Sep 23 2021, 10:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2021, 10:02 AM
jonpa added inline comments.Sep 23 2021, 10:07 AM
llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
296

hmm.. should the check for soft-float be done here instead?

uweigand accepted this revision.Sep 23 2021, 10:42 AM

LGTM, thanks!

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
296

No, I think it's better to have it in the implementation -- just in case we need to handle some other cases in BITCAST later.

This revision is now accepted and ready to land.Sep 23 2021, 10:42 AM
This revision was landed with ongoing or failed builds.Sep 24 2021, 1:28 AM
This revision was automatically updated to reflect the committed changes.