summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorBenoit Jacob <jacob.benoit.1@gmail.com>2024-02-28 13:56:18 -0500
committerGitHub <noreply@github.com>2024-02-28 13:56:18 -0500
commit9c7cde64e6556f8a04dc4a14cbfb2b277d5ab4d9 (patch)
treeb7e1f4b9edcdade3f03c3653fbe8f7d26840c613 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent2eb63982e88b9ed8336158d35884b1a1d04a0f78 (diff)
Fix the lowering of `arith.truncf : f32 to bf16`. (#83180)
This lowering was not correctly handling the case where saturation of the mantissa results in an increase of the exponent value. The new code borrows, with credit, the idea from https://github.com/pytorch/pytorch/blob/e1502c0cdbfd17548c612f25d5a65b1e4b86224d/c10/util/BFloat16.h#L60-L79 and adds comments to explain the magic trick going on here and why it's correct. Hat tip to its original author, whom I believe to be @Maratyszcza. A testcase was also requiring a tie to be broken upwards in a case where "to nearest-even" required going downward. The fact that it used to pass suggests that there was another bug in the old code.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions