Stop making assumptions about subnormals and NaN payloads
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
The behavior of subnormal numbers and signed zeros in particular is target-specific. Some platforms simply cannot support subnormals or signed zeros without software support code that might not be present. The only long-term solution I can think of is for LLVM to stop making assumptions about this:
- Treat operations on subnormal numbers as opaque.
- Do not constant-fold operations that produce subnormal numbers as intermediates (even if the final result is normal).
- Do not assume that the payload of NaNs is preserved.
- Do not assume that the sign of zero is preserved.
This will avoid problems on platforms that omit full IEEE 754 conformance in the interest of speed, cost, or power consumption.
Contributor guide
Assessment
This issue has not been assessed yet.