This is an archive of the discontinued LLVM Phabricator instance.

[Codegen][ARM] Add float softening for cbrt
ClosedPublic

Authored by dmgreen on Oct 23 2019, 9:25 AM.

Details

Summary

We would previously have no soft-float softening for cbrt, so could hit a crash failing to select. This fills in what appears to be missing.

Diff Detail

Event Timeline

dmgreen created this revision.Oct 23 2019, 9:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2019, 9:25 AM

Would it also make sense to add FCBRT to ExpandFloatResult and PromoteFloatResult? I don't know if it would be possible to test those though.

dmgreen updated this revision to Diff 226261.Oct 24 2019, 8:32 AM

Yeah, adding them is simple enough, but I'm not sure how those might be tested. I have added them here and included a test for halfs (which will not be converted into a cbrt, but if they were may then need promotion).

efriedma accepted this revision.Oct 24 2019, 2:23 PM

LGTM

For promote, you'd need a type with an explicit float specification. "expand" only applies to ppc_f128. So I doubt either case is reachable. But the code is simple enough that the lack of coverage is unlikely to matter.

This revision is now accepted and ready to land.Oct 24 2019, 2:23 PM
This revision was automatically updated to reflect the committed changes.