You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Subnormal f64 to f32 cast is incorrect in CTFE #113407
LLVM and Rust are both using apfloat for compile-time float computations, and yet the MIR opts produce 1 and LLVM produces 0. Is this something that was fixed in upstream apfloat but we don't have the fix yet?
Activity
RalfJung commentedon Jul 6, 2023
This is strange: https://godbolt.org/z/14GxTsfoM
LLVM and Rust are both using apfloat for compile-time float computations, and yet the MIR opts produce 1 and LLVM produces 0. Is this something that was fixed in upstream apfloat but we don't have the fix yet?
cbeuw commentedon Jul 6, 2023
Rust's apfloat port is old and unupdated for a long while. For instance #102403 was fixed upstream 6 years ago llvm/llvm-project@f2c2851
nikic commentedon Jul 6, 2023
The relevant fix is probably https://reviews.llvm.org/D127140?
RalfJung commentedon Jul 6, 2023
#113416 should work around this.
eddyb commentedon Jul 13, 2023
While trying to trigger a different issue involving float<->float conversions, I believe my
rustc_apfloatfuzzer (after commit rust-lang/rustc_apfloat@439177a) reproduced this one instead:(which is good confirmation that we can find such things. too bad about the FMA NaNs polluting fuzzer outputs)
EDIT: also see the longer update post at #55993 (comment)
eddyb commentedon Jul 18, 2023
As per #55993 (comment), this is now fixed in
rust-lang/rustc_apfloat.cbeuw commentedon Jul 18, 2023
This should be reopened until rustc starts using the stand-alone crate
eddyb commentedon Jul 18, 2023
Uh oh I did not do that, GH must've gotten overzealous cross-repo.
RalfJung commentedon Jul 18, 2023
You said "fixes #113407" in that PR, GH did the rest. ;)
Auto merge of rust-lang#113843 - wesleywiser:replace_rustc_apfloat, r…