diff options
| author | Ralf Jung <post@ralfj.de> | 2024-08-31 22:28:17 +0200 |
|---|---|---|
| committer | Jubilee Young <workingjubilee@gmail.com> | 2024-09-10 16:47:09 -0700 |
| commit | e556c136f3a4e5ff36afa248a6dd0e2cc9ddaced (patch) | |
| tree | 5a55079dbe033ec2b4b4eccb2878e4af88065383 | |
| parent | 3daa9518d5234d0768ba8ea81fd19c372ab98445 (diff) | |
clean up internal comments about float semantics
- remove an outdated FIXME - add reference to floating-point semantics issue Co-authored-by: Jubilee <workingjubilee@gmail.com>
| -rw-r--r-- | library/core/src/num/f16.rs | 1 | ||||
| -rw-r--r-- | library/core/src/num/f32.rs | 5 | ||||
| -rw-r--r-- | library/core/src/num/f64.rs | 5 | ||||
| -rw-r--r-- | tests/ui/numbers-arithmetic/issue-105626.rs | 1 |
4 files changed, 4 insertions, 8 deletions
diff --git a/library/core/src/num/f16.rs b/library/core/src/num/f16.rs index 9252e8c6015..da92da1086d 100644 --- a/library/core/src/num/f16.rs +++ b/library/core/src/num/f16.rs @@ -435,6 +435,7 @@ impl f16 { // WASM, see llvm/llvm-project#96437). These are platforms bugs, and Rust will misbehave on // such platforms, but we can at least try to make things seem as sane as possible by being // careful here. + // see also https://github.com/rust-lang/rust/issues/114479 if self.is_infinite() { // Thus, a value may compare unequal to infinity, despite having a "full" exponent mask. FpCategory::Infinite diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index 2bc89722497..885f7608a33 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -662,10 +662,7 @@ impl f32 { // hardware flushes subnormals to zero. These are platforms bugs, and Rust will misbehave on // such hardware, but we can at least try to make things seem as sane as possible by being // careful here. - // - // FIXME(jubilee): Using x87 operations is never necessary in order to function - // on x86 processors for Rust-to-Rust calls, so this issue should not happen. - // Code generation should be adjusted to use non-C calling conventions, avoiding this. + // see also https://github.com/rust-lang/rust/issues/114479 if self.is_infinite() { // A value may compare unequal to infinity, despite having a "full" exponent mask. FpCategory::Infinite diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index b3f5be9fc8a..28cc231ccc7 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -660,10 +660,7 @@ impl f64 { // float semantics Rust relies on: x87 uses a too-large exponent, and some hardware flushes // subnormals to zero. These are platforms bugs, and Rust will misbehave on such hardware, // but we can at least try to make things seem as sane as possible by being careful here. - // - // FIXME(jubilee): Using x87 operations is never necessary in order to function - // on x86 processors for Rust-to-Rust calls, so this issue should not happen. - // Code generation should be adjusted to use non-C calling conventions, avoiding this. + // see also https://github.com/rust-lang/rust/issues/114479 // // Thus, a value may compare unequal to infinity, despite having a "full" exponent mask. // And it may not be NaN, as it can simply be an "overextended" finite value. diff --git a/tests/ui/numbers-arithmetic/issue-105626.rs b/tests/ui/numbers-arithmetic/issue-105626.rs index f942cf1283d..8d4a7c308e7 100644 --- a/tests/ui/numbers-arithmetic/issue-105626.rs +++ b/tests/ui/numbers-arithmetic/issue-105626.rs @@ -11,6 +11,7 @@ fn main() { assert_ne!((n as f64) as f32, n as f32); // FIXME: these assertions fail if only x87 is enabled + // see also https://github.com/rust-lang/rust/issues/114479 assert_eq!(n as i64 as f32, r); assert_eq!(n as u64 as f32, r); } |
