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

Use apfloat for full-precision sqrt #3534

Open
RalfJung opened this issue May 2, 2024 · 0 comments
Open

Use apfloat for full-precision sqrt #3534

RalfJung opened this issue May 2, 2024 · 0 comments
Labels
A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement S-blocked Status: blocked on something happening somewhere else

Comments

@RalfJung
Copy link
Member

RalfJung commented May 2, 2024

With rust-lang/rust#121793 and rust-lang/rust#118217, most float functions are now documented to have varying precision, so using host floats for them in Miri is actually fine. The only exceptions are mul_add (tracked at #2995) and sqrt -- those guarantee an infinite-precision result, so we should ideally use softfloats. (That said, using host floats is not wrong here since the host functions are in fact guaranteeing the infinite-precision result we are supposed to be emulating. Still, it seems cleaner to use softfloats for everything where precision is guaranteed.)

This is blocked on rust-lang/rustc_apfloat#14.

@RalfJung RalfJung changed the title Use softfloats for sqrt Use apfloat for full-precision sqrt May 2, 2024
@RalfJung RalfJung added A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement labels May 2, 2024
bors added a commit that referenced this issue May 2, 2024
update host-float comments

Turns out most of these do not have guaranteed precision anyway so it's fine to use host floats (see rust-lang/rust#121793 and rust-lang/rust#118217). The exception are sqrt and mul_add, tracked at #3534 and #2995.
RalfJung pushed a commit to RalfJung/rust that referenced this issue May 4, 2024
update host-float comments

Turns out most of these do not have guaranteed precision anyway so it's fine to use host floats (see rust-lang#121793 and rust-lang#118217). The exception are sqrt and mul_add, tracked at rust-lang/miri#3534 and rust-lang/miri#2995.
@RalfJung RalfJung added the S-blocked Status: blocked on something happening somewhere else label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement S-blocked Status: blocked on something happening somewhere else
Projects
None yet
Development

No branches or pull requests

1 participant