Skip to content

Wrong results in some FMA cases #11

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

Closed
RalfJung opened this issue Sep 29, 2023 · 3 comments · Fixed by #21
Closed

Wrong results in some FMA cases #11

RalfJung opened this issue Sep 29, 2023 · 3 comments · Fixed by #21

Comments

@RalfJung
Copy link
Member

Due to this being an exact port of the LLVM library, this crate is affected by llvm/llvm-project#63895: some FMA produce wrong results. This seems worth tracking on our side as well, if only to make it easier to find, given that "produces wrong result" is the worst kind of bug.

@beetrees
Copy link
Contributor

I've posted a PR to fix this in LLVM at llvm/llvm-project#98721. I've also made a Rust port of the fix at https://github.com/beetrees/rustc_apfloat/tree/fix-mul-add.

@RalfJung
Copy link
Member Author

llvm/llvm-project#63895 has been fixed upstream. Can we get that fix into the Rust port as well? :) Cc @eddyb @wesleywiser

@RalfJung
Copy link
Member Author

@beetrees could you make a PR for your branch?

workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 12, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 13, 2025
…li-obk

miri: we can use apfloat's mul_add now

With rust-lang/rustc_apfloat#11 fixed, there is no reason to still use host floats here.
Fixes rust-lang/miri#2995

We already have a test for this:
https://github.com/rust-lang/rust/blob/a7153db254acc387e271e75153bdbd3caa2bed89/src/tools/miri/tests/pass/float.rs#L998-L1003

r? ``@oli-obk``
rust-timer added a commit to rust-lang/rust that referenced this issue Jun 13, 2025
Rollup merge of #142340 - RalfJung:miri-apfloat-mul-add, r=oli-obk

miri: we can use apfloat's mul_add now

With rust-lang/rustc_apfloat#11 fixed, there is no reason to still use host floats here.
Fixes rust-lang/miri#2995

We already have a test for this:
https://github.com/rust-lang/rust/blob/a7153db254acc387e271e75153bdbd3caa2bed89/src/tools/miri/tests/pass/float.rs#L998-L1003

r? ``@oli-obk``
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Jun 14, 2025
miri: we can use apfloat's mul_add now

With rust-lang/rustc_apfloat#11 fixed, there is no reason to still use host floats here.
Fixes #2995

We already have a test for this:
https://github.com/rust-lang/rust/blob/a7153db254acc387e271e75153bdbd3caa2bed89/src/tools/miri/tests/pass/float.rs#L998-L1003

r? ``@oli-obk``
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this issue Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants