Description
Compilers should never rely on host floating-point support, as that can lead to host-specific behavioral subtleties (instead of behavior being deterministically tied to the target architecture/platform), and in many cases there's not enough to gain to even look into what guarantees certain host architectures/platforms may offer.
For rustc
we ported LLVM's C++ APFloat
library to Rust (for e.g. evaluating float operations in constant expressions), but rspirv
itself only needs to store literals, not operate on the actual values (and consumers could choose how to interpret the bits of a floating-point value, any way they want).
I'm not sure how what the timeline for 0.8 is, but this would be a breaking change.
Also, it would help with #16.
cc @khyperia