This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes] Add SoftenFloatRes_Unary and SoftenFloatRes_Binary functions to factor repeated patterns out of many of the SoftenFloatRes_* functions
ClosedPublic

Authored by craig.topper on Nov 26 2019, 11:47 AM.

Details

Summary

This has been factored out of D70654 which will add strict FP support to these functions. By making the helpers we avoid repeating even more code.

Diff Detail

Event Timeline

craig.topper created this revision.Nov 26 2019, 11:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 26 2019, 11:47 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper marked an inline comment as done.Nov 26 2019, 11:47 AM
craig.topper added inline comments.
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
200

Are these functions simple enough now that we should just inline this into the switch?

efriedma accepted this revision.Nov 26 2019, 12:33 PM

LGTM

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
200

Inlining wouldn't make it easier to read, I think.

We could turn the opcode->rtlib call mapping into a table, then merge all the switch cases, if you wanted to. But I don't think that's necessary.

This revision is now accepted and ready to land.Nov 26 2019, 12:33 PM
This revision was automatically updated to reflect the committed changes.