rust-lang / lang-team

Home of the Rust lang team
http://lang-team.rust-lang.org/
Apache License 2.0
200 stars 48 forks source link

Design meeting: Float semantics (RFC 3514) #273

Closed traviscross closed 1 month ago

traviscross commented 3 months ago

Summary

We'll meet to discuss float semantics.

Background reading

About this issue

This issue corresponds to a lang-team design meeting proposal. It corresponds to a possible topic of discussion that may be scheduled for deeper discussion during one of our design meetings.

cc @RalfJung

pnkfelix commented 2 months ago

(the reason I cc'ed this issue from https://github.com/rust-lang/rust/issues/124364 is that I wanted to ensure that this comment from Ralf does not get overlooked in that meeting: https://github.com/rust-lang/rust/issues/124364#issuecomment-2089737485; some relevant quotes below.)

If LLVM assumes float operations are deterministic then indeed it must not do any const-folding that differs from the effective runtime behavior.

Non-deterministic NaNs can cause miscompilations.

RalfJung commented 2 months ago

Non-deterministic NaNs can cause miscompilations.

This part got fixed in https://github.com/llvm/llvm-project/pull/90942.