This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by craig.topper on Nov 24 2019, 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.Nov 24 2019, 11:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2019, 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.Nov 25 2019, 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.Nov 26 2019, 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.Nov 26 2019, 5:29 PM
This revision was automatically updated to reflect the committed changes.