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

miri: implement square root without relying on host floats #4026

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

eduardosm
Copy link
Contributor

@eduardosm eduardosm commented Nov 10, 2024

@bors
Copy link
Contributor

bors commented Nov 11, 2024

☔ The latest upstream changes (presumably #4029) made this pull request unmergeable. Please resolve the merge conflicts.

@eduardosm eduardosm force-pushed the soft-sqrt branch 2 times, most recently from bde6ebb to a8f30d7 Compare November 12, 2024 18:21
Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

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

This is great, thanks! However, there are some parts I don't quite understand.

src/math.rs Show resolved Hide resolved
src/math.rs Show resolved Hide resolved
src/math.rs Outdated Show resolved Hide resolved
src/math.rs Outdated Show resolved Hide resolved
src/math.rs Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

@rustbot author

@rustbot rustbot added the S-waiting-on-author Status: Waiting for the PR author to address review comments label Nov 16, 2024
@eduardosm
Copy link
Contributor Author

I added some comments, I hope it is more clear now.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels Nov 17, 2024
@eduardosm eduardosm force-pushed the soft-sqrt branch 2 times, most recently from 16230fb to 726efe0 Compare November 20, 2024 18:37
src/math.rs Outdated Show resolved Hide resolved
@RalfJung RalfJung added this pull request to the merge queue Nov 20, 2024
@RalfJung
Copy link
Member

Thanks a lot, great to finally have a proper implementation of the last missing standard IEEE float operation. :)

Merged via the queue into rust-lang:master with commit bbf8747 Nov 20, 2024
7 checks passed
@eduardosm eduardosm deleted the soft-sqrt branch November 20, 2024 20:10
(val * (F::from_u128(1).value + err).value).value
}

pub(crate) fn sqrt<S: rustc_apfloat::ieee::Semantics>(x: IeeeFloat<S>) -> IeeeFloat<S> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is specified in 754 right? It should probably just go in https://github.com/rust-lang/rustc_apfloat

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we have an open issue for that: rust-lang/rustc_apfloat#14.

However, last time we wanted to change rustc_apfloat the answer was that things should land in LLVM first and then rustc_apfloat will pick them up from there. That's a quite tedious process. Not sure if that is still the current policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Waiting for a review to complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants