rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.16k stars 318 forks source link

support `f*_algebraic` #3596

Closed bend-n closed 1 month ago

bend-n commented 1 month ago

supports the f*_algebraic intrinsics.

RalfJung commented 1 month ago

Thanks!

This should use adjust_nan to avoid making any guarantees about the NaNs being returned.

Ideally, we'd also not return the exact result but perturb it a bit, to drive home the point that these operations are non-deterministic. But the existing fast-math intrinsics don't do that either so we can leave that to https://github.com/rust-lang/miri/issues/3555.

bend-n commented 1 month ago

This should use adjust_nan to avoid making any guarantees about the NaNs being

the comment on f*_fast says that wrapping_binary_op already calls generate_nan?

RalfJung commented 1 month ago

the comment on f*_fast says that wrapping_binary_op already calls generate_nan?

Ah, you're right, thanks!

RalfJung commented 1 month ago

Thanks, looks good. :)

Please squash the commits.

RalfJung commented 1 month ago

@bors r+

bors commented 1 month ago

:pushpin: Commit 18379e8e70c6ab5d79bb19d0b37c2a1d964928d6 has been approved by RalfJung

It is now in the queue for this repository.

bors commented 1 month ago

:hourglass: Testing commit 18379e8e70c6ab5d79bb19d0b37c2a1d964928d6 with merge 24fc363cbcb04e686ff399b9a96babb99e50b45e...

bors commented 1 month ago

:sunny: Test successful - checks-actions Approved by: RalfJung Pushing 24fc363cbcb04e686ff399b9a96babb99e50b45e to master...