10 Commits

Author SHA1 Message Date
Trevor Gross
2b9256e1c8 Move applicable float tests from coretests back to std
The previous commit moved all test files from `std` to `core` so git
understands the move. Not all functionality is actually testable in
`core`, however, so perform move the relevant portions back. Changes
from inherent to module methods is also done since this is the form of
math operations available in `core` (as `core_float_math`).
2025-05-14 14:29:58 +00:00
Trevor Gross
48f3e63f70 Move float tests from std to core
Many float-related tests in `std` only depend on `core`, so move the
tests there. This also allows us to verify functions from
`core_float_math`.

Since the majority of test files need to be moved to `coretests`, move
the files here without any cleanup; this is done in a followup commit.
This makes git history slightly cleaner, but coretests will not build
immediately after this commit.
2025-05-13 22:22:15 +00:00
Pietro Albini
2ce08ca5d6
update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
Trevor Gross
dfa972e454 Use feature(target_has_reliable_f16_f128) in library tests
New compiler configuration has been introduced that is designed to
replace the build script configuration `reliable_f16`, `reliable_f128`,
`reliable_f16_math`, and `reliable_f128_math`. Do this replacement here,
which allows us to clean up `std`'s build script.

All tests are gated by `#[cfg(bootstrap)]` rather than doing a more
complicated `cfg(bootstrap)` / `cfg(not(bootstrap))` split since the
next beta split is within two weeks.
2025-04-27 20:10:33 +00:00
Ralf Jung
e7a865448a test_nan: ensure the NAN contant is quiet 2025-04-22 09:06:43 +02:00
Calder Coalson
8ff70529f2 Expose algebraic floating point intrinsics 2025-04-04 16:13:57 -07:00
bors
c3dd4eefd6 Auto merge of #138363 - beetrees:f16-f128-integer-convert, r=Amanieu
Add `From<{integer}>` for `f16`/`f128` impls

This PR adds `impl From<{bool,i8,u8}> for f16` and `impl From<{bool,i8,u8,i16,u16,i32,u32}> for f128`.

The `From<{i64,u64}> for f128` impls are left commented out as adding them would allow using `f128` on stable before it is stabilised like in the following example:
```rust
fn f<T: From<u64>>(x: T) -> T { x }

fn main() {
    let x = f(1.0); // the type of the literal is inferred to be `f128`
}
```
None of the impls added in this PR have this issue as they are all, at minimum, also implemented by `f64`.

This PR will need a crater run for the `From<{i32,u32}>` impls, as `f64` is no longer the only float type to implement them (similar to the cause of #125198).

cc `@bjoernager`
r? `@tgross35`

Tracking issue: #116909
2025-03-17 00:33:36 +00:00
beetrees
7c0726521f
Add From<{integer}> for f16/f128 impls 2025-03-11 18:58:54 +00:00
Trevor Gross
47ba5bd41e Enable f16 tests for powf
The LLVM issue [1] was fixed with [2], which is included in the LLVM20
upgrade. Tests no longer fail, so enable them here.

[1]: https://github.com/llvm/llvm-project/pull/98681
[2]: https://github.com/llvm/llvm-project/pull/98681
2025-03-11 12:13:01 +00:00
bjorn3
29166cd617 Move std float unit tests to integration tests 2025-01-26 10:28:04 +00:00