HomePhabricator

[WebAssembly] Avoid `bit_cast` when printing f32 and f64 immediates

Authored by sunfish on Feb 26 2021, 2:17 PM.

Description

[WebAssembly] Avoid bit_cast when printing f32 and f64 immediates

Use APInt to convert a 32-bit or 64-bit immediate to an APFloat rather than
bit_cast to a float or double to avoid going through host floating-point and
potentially changing the bit pattern of NaNs.

Differential Revision: https://reviews.llvm.org/D97490