Skip to content
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

Disable jump threading of float equality #826

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Aug 6, 2024

Jump threading stores values as u128 (ScalarInt) and does its comparisons for equality as integer comparisons.
This works great for integers. Sadly, not everything is an integer.

Floats famously have wonky equality semantcs, with NaN!=NaN and 0.0 == -0.0. This does not match our beautiful integer bitpattern equality and therefore causes things to go horribly wrong.

While jump threading could be extended to support floats by remembering that they're floats in the value state and handling them properly, it's signficantly easier to just disable it for now.

Ferrocene-backport-of: rust-lang/rust#128271

@Veykril Veykril changed the title Backport: Disable jump threading of float equality Disable jump threading of float equality Aug 6, 2024
Jump threading stores values as `u128` (`ScalarInt`) and does its
comparisons for equality as integer comparisons.
This works great for integers. Sadly, not everything is an integer.

Floats famously have wonky equality semantcs, with `NaN!=NaN` and
`0.0 == -0.0`. This does not match our beautiful integer bitpattern
equality and therefore causes things to go horribly wrong.

While jump threading could be extended to support floats by remembering
that they're floats in the value state and handling them properly,
it's signficantly easier to just disable it for now.

Ferrocene-backport-of: #128271
@Veykril Veykril force-pushed the lw-backport-1.79-128271 branch from 91448f4 to a884a13 Compare August 6, 2024 07:48
Copy link
Member

@Hoverbear Hoverbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

@bors-ferrocene
Copy link
Contributor

bors-ferrocene bot commented Aug 7, 2024

Build succeeded:

  • full

@bors-ferrocene bors-ferrocene bot merged commit 70c6696 into release/1.79 Aug 7, 2024
3 checks passed
@bors-ferrocene bors-ferrocene bot deleted the lw-backport-1.79-128271 branch August 7, 2024 19:50
@pietroalbini pietroalbini restored the lw-backport-1.79-128271 branch August 8, 2024 08:06
@pietroalbini pietroalbini deleted the lw-backport-1.79-128271 branch August 8, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants