-
Notifications
You must be signed in to change notification settings - Fork 267
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
Deprecate MXCSR-related intrinsics #817
Conversation
r? @gnzlbg (rust_highfive has picked a reviewer for you, use r? to override) |
cc @rkruppe Is reading the MXCSR ok ? If not, why is that UB ? |
This doesn't contain the magic words "behavior is undefined" but if you believe that writing MXCSR is UB, then this wording indicates that reading it is also UB because the UB flows from the assumption that the LLVM IR instructions are side-effect free and both reading and writing FP exception state conflicts with that. |
What's the side-effect of reading the MXCSR register ? |
Reading doesn't have side effects AFAIK, but doing reads contradicts the assumption that floating point instructions don't have side effects (because they affect which value gets read from MXCSR). |
☔ The latest upstream changes (presumably 0716b22) made this pull request unmergeable. Please resolve the merge conflicts. |
I've rebased the PR, the build failures seem to be unrelated to the MXCSR changes. |
The build failures should be fixed now, can you rebase again? |
@Amanieu I've fixed some of the tests, but there are still others which use |
I think it's fine to leave the tests as they are for now and just allow the warning. |
With that said, there have been changes in LLVM since this PR was opened in 2019 and I am not sure if the original reasons for deprecating these functions still apply. |
@Amanieu Hmm, you're right, I'm not convinced using them is instantly undefined behavior anymore. I'm going to close this PR for now and leave a comment on the original issue, if someone's interested in further investigating the problem. |
Fixes #781.