Commit 44bf4c89 authored by Mikhail R. Gadelha's avatar Mikhail R. Gadelha
Browse files

[libc] Fix float to string conversion in 32-bit systems

In 32-bit systems, sizeof(size_t) is 4, so we fail to build an 128-bit
integer in mul_shift_mod_1e9, which ends up ignoring the top bits in the
mantissa.

This patch fixes the issue by calling the Uint constructor directly. If
it's a system that supports 128-bit integers, the constructor that takes
a value will be called, if the system doesn't support 128-bit integers
(like rv32), mantissa is already a UInt.

Reviewed By: lntue, michaelrj

Differential Revision: https://reviews.llvm.org/D156813
parent 37ef6407
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment