This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix materialization of SP float values on Power10
ClosedPublic

Authored by lei on Jul 26 2021, 10:32 AM.

Details

Summary

All floating point values in registers are in double precision
representation. In order to materialize the correct single precision
value, we need to convert the APFloat that represents the value
to double precision first.

Diff Detail

Event Timeline

lei created this revision.Jul 26 2021, 10:32 AM
lei requested review of this revision.Jul 26 2021, 10:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2021, 10:32 AM
NeHuang added inline comments.Jul 26 2021, 10:50 AM
llvm/lib/Target/PowerPC/PPCInstrInfo.td
415

Do we need to check LosesInfo to ensure lossless conversion?

426

same as above.

nemanjai added inline comments.Jul 26 2021, 1:27 PM
llvm/lib/Target/PowerPC/PPCInstrInfo.td
415

IIUC It is not possible for a value to be representable in single precision but not double precision. I suppose we can add:
assert(!LosesInfo && "conversion from SP to DP loses info?")

lei updated this revision to Diff 361808.Jul 26 2021, 2:32 PM

change variable name to indicate it's not used.

amyk accepted this revision.Jul 26 2021, 2:55 PM

LGTM.

This revision is now accepted and ready to land.Jul 26 2021, 2:55 PM
NeHuang accepted this revision.Jul 26 2021, 3:02 PM

LGTM. Thanks.

llvm/lib/Target/PowerPC/PPCInstrInfo.td
415

Thanks. Agreed. If we decided not adding the assert, maybe just change the

This revision was landed with ongoing or failed builds.Jul 26 2021, 5:43 PM
This revision was automatically updated to reflect the committed changes.