-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVM (thus, Rust) floating point support support is incomplete #10186
Comments
cc @nikomatsakis since i think this is relevant to a point of discussion from last night's triage meeting. |
triage bump: I don't follow LLVM development closely enough to know if anything has changed here, but it's true, if they're deficient, it's going to be hard for us. |
This is https://bugs.llvm.org//show_bug.cgi?id=8100 on the LLVM side; it's a longstanding issue. |
Triage: LLVM bug is still open. |
Since https://reviews.llvm.org/D27028 (late January 2017), LLVM has had experimental intrinsics for floating-point environment support (see |
@bstrie: I've not found one, unfortunately 😕The process seems to be ad hoc. From what I could tell, the intrinsics should be correct, but not necessarily efficient. |
The intrinsics exist in IR but last I heard backend support was incomplete, at least in the sense that dependencies between instructions that affect or are affected by the floating point environment are not respected in MachineIR. |
Is that true? I seem to recall that LLVM just doesn't care about signalling vs not-signalling, and so does most hardware. So for those platforms, they are not UB, they are just not implemented. |
Will rust adopt the correct or the efficient semantics for fp math? Is there already some way to use what intrinsics llvm does have in rust? |
That is not true. Signalling NaNs are not behaving entirely in line with IEEE, but they do not cause UB. #73328 is tracking the exact documentation of that.
That is true, but currently "working as intended". So this is not considered "incomplete". If someone wants to track support for custom FP environments, please open a feature request. This would require an RFC, and very careful design since we do not want to impede out ability to optimize regular floating-point operations assuming the default environment. |
This is not going to be easy to fix since the only sane fix is to improve LLVM.
The text was updated successfully, but these errors were encountered: