mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Extend SwiftDtoa to provide optimal formatting for Float16 and use that for `Float16.description` and `Float16.debugDescription`. Notes on signaling NaNs: LLVM's Float16 support passes Float16s on x86 by legalizing to Float32. This works well for most purposes but incidentally loses the signaling marker from any NaN (because it's a conversion as far as the hardware is concerned), with a side effect that the print code never actually sees a true sNaN. This is similar to what happens with Float and Double on i386 backends. The earlier code here tried to detect sNaN in a different way, but that approach isn't guaranteed to work so we decided to make this code use the correct detection logic -- sNaN printing will just be broken until we can get a better argument passing convention. Resolves rdar://61414101
5.7 KiB
5.7 KiB