This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Reimplement half2float
Needs ReviewPublic

Authored by teemperor on May 20 2021, 7:59 AM.

Details

Summary

I had to debug LLDB's implementation of extend-half-to-float and while it's quite efficient
it also suffered from some UB (see rG4b074b49be206306330076b9fa40632ef1960823 )
and figuring out why we multiply with all those undocumented numbers isn't very fun.

This is a rewrite that is (hopefully) more readable and explains where all the numbers actually
come from. It's also less efficient, but as this is only used for dumping floating point numbers
from a target to a stringstream I don't think the few additional instructions do a lot of harm.

Diff Detail

Event Timeline

teemperor created this revision.May 20 2021, 7:59 AM
teemperor requested review of this revision.May 20 2021, 7:59 AM

FWIW, compiler-rt has a generic version of this function that I wish we could use instead. But I don't think we have any way to reuse compiler-rt functionality from within LLDB?