Page MenuHomePhabricator

[LegalizeTypes][FPEnv][X86] Add initial support for softening strict fp nodes
ClosedPublic

Authored by craig.topper on Sun, Nov 24, 11:38 PM.

Details

Summary

This is based on what's required for softening fp128 operations on 32-bit X86 assuming f32/f64/f80 are legal. So there could be some things missing.

Diff Detail

Event Timeline

craig.topper created this revision.Sun, Nov 24, 11:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptSun, Nov 24, 11:38 PM

Could you split the refactoring to introduce SoftenFloatRes_Unary and SoftenFloatRes_Binary into a separate patch?

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

This is different from the other operations?

craig.topper marked an inline comment as done.Mon, Nov 25, 1:00 PM
craig.topper added inline comments.
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
878

There's an assert in the caller than checks that the node only has a single result if you return a node. This assert only exists in the softening operand case. The softening result does not do this check. Returning SDValue() bypasses the assert. The same problem came up in vector splitting for operands and the assert was modified into 2 asserts that are selected based on whether the node is strict or not. I could do the same here, but it seemed like spreading strict fp details to a place that didn't really need to know about it.

Rebase after pre-commiting some of the refactoring

Add support for LRINT/LLRINT/LROUND/LLROUND as well

efriedma accepted this revision.Tue, Nov 26, 5:29 PM

LGTM, but I'd appreciate if someone following the STRICT_FP stuff a bit more closely could look to make sure the libcalls we're generating make sense.

This revision is now accepted and ready to land.Tue, Nov 26, 5:29 PM
This revision was automatically updated to reflect the committed changes.