-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC #68033
Conversation
These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
One hesitation I have is that on for example x86_64 MSVC some of these functions give slightly different results which look like they're actually less accurate. That makes this technically a breaking change but I don't know if we have strong stability or accuracy guarantees for these functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks!
It looks like the existing workaround was added in #26601 before the LLVM fix to support Windows XP. At some point we should drop XP support and remove the remaining shims... https://internals.rust-lang.org/t/consider-dropping-support-for-windows-xp/8745
Regarding accuracy, the comment in cmath.rs acknowledges that the f64 promoted operations do not exactly match the f32 operations but were only "accurate enough for now".
FYI @alexcrichton
@bors r+ |
📌 Commit 084217a has been approved by |
Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.
Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.
Rollup of 5 pull requests Successful merges: - #68033 (Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC) - #68244 (Enable leak sanitizer test case) - #68255 (Remove unused auxiliary file that was replaced with rust_test_helpers) - #68263 (rustdoc: HTML escape codeblocks which fail syntax highlighting) - #68274 (remove dead code) Failed merges: r? @ghost
Just to be clear, these shims were added to support the
The shims are still needed even in 32-bit x86 Windows 10 so we won't be able to remove them unfortunately. |
These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.