| Age | Commit message (Collapse) | Author | Lines |
|
This function is significantly slower than all others so includes an
override in `EXTREMELY_SLOW_TESTS`. Without it, PR CI takes ~1hour and
the extensive tests in CI take ~1day.
|
|
Certain functions (`fmodf128`) are significantly slower than others,
to the point that running the default number of tests adds tens of
minutes to PR CI and extensive test time increases to ~1day. It does not
make sense to do this by default; so, introduce `EXTREMELY_SLOW_TESTS`
to test configuration that allows setting specific tests that need to
have a reduced iteration count.
|
|
With the new routines, some of our tests are running close to their
timeouts. Increase the timeout for test jobs, and set a short timeout
for all other jobs that did not have one.
|
|
Implement `VecDeque::pop_front_if` & `VecDeque::pop_back_if`
Tracking issue: #135889
|
|
remove pointless allowed_through_unstable_modules on TryFromSliceError
This got added in https://github.com/rust-lang/rust/pull/132482 but the PR does not explain why. `@lukas-code` do you still remember? Also Cc `@Noratrieb` as reviewer of that PR.
If I understand the issue description correctly, all paths under which this type is exported are stable now: `core::array::TryFromSliceError` and `std::array::TryFromSliceError`. If that is the case, we shouldn't have the attribute; it's a terrible hack that should only be used when needed to maintain backward compatibility. Getting some historic information right is IMO *not* sufficient justification to risk accidentally exposing this type via more unstable paths today or in the future.
|
|
The `fill` value by default should be set to `' '` (space), but the current implementation uses `#[derive(Default)]` which sets it to `\0`
|
|
|
|
This can replace `fmod` and `fmodf`. As part of this change I was able
to replace some of the `while` loops with `leading_zeros`.
|
|
Rollup of 7 pull requests
Successful merges:
- #135366 (Enable `unreachable_pub` lint in `test` and `proc_macro` crates)
- #135638 (Make it possible to build GCC on CI)
- #135648 (support wasm inline assembly in `naked_asm!`)
- #135827 (CI: free disk with in-tree script instead of GitHub Action)
- #135855 (Only assert the `Parser` size on specific arches)
- #135878 (ci: use 8 core arm runner for dist-aarch64-linux)
- #135905 (Enable kernel sanitizers for aarch64-unknown-none-softfloat)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
These can be used for `fmin`, `fminf`, `fmax`, and `fmaxf`. No changes
to the implementation are made, so [1] is not fixed.
[1]: https://github.com/rust-lang/libm/issues/439
|
|
|
|
|
|
This replaces `round` and `roundf`.
|
|
Enable `unreachable_pub` lint in `test` and `proc_macro` crates
This PR enables the [`unreachable_pub`](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unreachable-pub) lint as warn in the `test` and `proc_macro` crates.
The diff was mostly generated with `./x.py fix --stage 1 library/proc_macro/ -- --broken-code`, as well as manual edits for code in macros and in tests.
Continuation of #134286
r? libs
|
|
This replaces the `f32` and `f64` versions of `scalbn` and `ldexp`.
|
|
|
|
Implement `ByteStr` and `ByteString` types
Approved ACP: https://github.com/rust-lang/libs-team/issues/502
Tracking issue: https://github.com/rust-lang/rust/issues/134915
These types represent human-readable strings that are conventionally,
but not always, UTF-8. The `Debug` impl prints non-UTF-8 bytes using
escape sequences, and the `Display` impl uses the Unicode replacement
character.
This is a minimal implementation of these types and associated trait
impls. It does not add any helper methods to other types such as `[u8]`
or `Vec<u8>`.
I've omitted a few implementations of `AsRef`, `AsMut`, and `Borrow`,
when those would be the second implementation for a type (counting the
`T` impl), to avoid potential inference failures. We can attempt to add
more impls later in standalone commits, and run them through crater.
In addition to the `bstr` feature, I've added a `bstr_internals` feature
for APIs provided by `core` for use by `alloc` but not currently
intended for stabilization.
This API and its implementation are based *heavily* on the `bstr` crate
by Andrew Gallant (`@BurntSushi).`
r? `@BurntSushi`
|
|
|
|
Make things more consistent with other API that works with a bitwise
representation of the exponent. That is, use `u32` when working with a
bitwise (biased) representation, use `i32` when the bitwise
representation has been adjusted for bias and ay be negative.
Every place this has been used so far has an `as i32`, so this change
makes things cleaner anyway.
|
|
Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`
https://github.com/rust-lang/rust/pull/128309#discussion_r1921097773
Tracking issue: https://github.com/rust-lang/rust/issues/107540
|
|
Currently our XFAILs are open ended; we do not check that it actually
fails, so we have no easy way of knowing that a previously-failing test
starts passing. Introduce a new enum that we return from overrides to
give us more flexibility here, including the ability to assert that
expected failures happen.
With the new enum, it is also possible to specify ULP via return value
rather than passing a `&mut u32` parameter.
This includes refactoring of `precision.rs` to be more accurate about
where errors come from, if possible.
Fixes: https://github.com/rust-lang/libm/issues/455
|
|
Expand the existing hex float functions and macros with versions that
work with `f16` and `f128`.
|
|
|
|
|
|
|
|
Library: Finalize dyn compatibility renaming
Update the Reference link to use the new URL fragment from https://github.com/rust-lang/reference/pull/1666 (this change has finally hit stable). Fixes a FIXME.
Follow-up to #130827.
Part of #130852.
|
|
Remove test panic from File::open
Fixes #135831
|
|
|
|
|
|
|
|
Use the generic algorithms to provide implementations for these
routines.
|
|
Use this to implement `rint` and `rintf`.
|
|
|
|
Use the generic algorithms to provide implementations for these
routines.
|
|
Additionally, make use of this version to implement `floor` and
`floorf`.
Similar to `ceil`, musl'f `ceilf` routine seems to work better for all
float widths than the `ceil` algorithm. Trying with the `ceil` (`f64`)
algorithm produced the following regressions:
icount::icount_bench_floor_group::icount_bench_floor logspace:setup_floor()
Performance has regressed: Instructions (14064 > 13171) regressed by +6.78005% (>+5.00000)
Baselines: softfloat|softfloat
Instructions: 14064|13171 (+6.78005%) [+1.06780x]
L1 Hits: 16821|15802 (+6.44855%) [+1.06449x]
L2 Hits: 0|0 (No change)
RAM Hits: 8|9 (-11.1111%) [-1.12500x]
Total read+write: 16829|15811 (+6.43856%) [+1.06439x]
Estimated Cycles: 17101|16117 (+6.10535%) [+1.06105x]
icount::icount_bench_floorf128_group::icount_bench_floorf128 logspace:setup_floorf128()
Baselines: softfloat|softfloat
Instructions: 166868|N/A (*********)
L1 Hits: 221429|N/A (*********)
L2 Hits: 1|N/A (*********)
RAM Hits: 34|N/A (*********)
Total read+write: 221464|N/A (*********)
Estimated Cycles: 222624|N/A (*********)
icount::icount_bench_floorf16_group::icount_bench_floorf16 logspace:setup_floorf16()
Baselines: softfloat|softfloat
Instructions: 143029|N/A (*********)
L1 Hits: 176517|N/A (*********)
L2 Hits: 1|N/A (*********)
RAM Hits: 13|N/A (*********)
Total read+write: 176531|N/A (*********)
Estimated Cycles: 176977|N/A (*********)
icount::icount_bench_floorf_group::icount_bench_floorf logspace:setup_floorf()
Performance has regressed: Instructions (14732 > 10441) regressed by +41.0976% (>+5.00000)
Baselines: softfloat|softfloat
Instructions: 14732|10441 (+41.0976%) [+1.41098x]
L1 Hits: 17616|13027 (+35.2268%) [+1.35227x]
L2 Hits: 0|0 (No change)
RAM Hits: 8|6 (+33.3333%) [+1.33333x]
Total read+write: 17624|13033 (+35.2260%) [+1.35226x]
Estimated Cycles: 17896|13237 (+35.1968%) [+1.35197x]
|
|
Use the generic algorithms to provide implementations for these
routines.
|
|
Additionally, make use of this version to implement `ceil` and `ceilf`.
Musl's `ceilf` algorithm seems to work better for all versions of the
functions. Testing with a generic version of musl's `ceil` routine
showed the following regressions:
icount::icount_bench_ceil_group::icount_bench_ceil logspace:setup_ceil()
Performance has regressed: Instructions (14064 > 13171) regressed by +6.78005% (>+5.00000)
Baselines: softfloat|softfloat
Instructions: 14064|13171 (+6.78005%) [+1.06780x]
L1 Hits: 16697|15803 (+5.65715%) [+1.05657x]
L2 Hits: 0|0 (No change)
RAM Hits: 7|8 (-12.5000%) [-1.14286x]
Total read+write: 16704|15811 (+5.64797%) [+1.05648x]
Estimated Cycles: 16942|16083 (+5.34104%) [+1.05341x]
icount::icount_bench_ceilf_group::icount_bench_ceilf logspace:setup_ceilf()
Performance has regressed: Instructions (14732 > 9901) regressed by +48.7931% (>+5.00000)
Baselines: softfloat|softfloat
Instructions: 14732|9901 (+48.7931%) [+1.48793x]
L1 Hits: 17494|12611 (+38.7202%) [+1.38720x]
L2 Hits: 0|0 (No change)
RAM Hits: 6|6 (No change)
Total read+write: 17500|12617 (+38.7018%) [+1.38702x]
Estimated Cycles: 17704|12821 (+38.0860%) [+1.38086x]
|
|
|
|
`exp` does not perform any form of unbiasing, so there isn't any reason
it should be signed. Change this.
Additionally, add `EPSILON` to the `Float` trait.
|
|
This may allow for small optimizations with larger float types since
`u32` math can be used after shifting. LLVM may be already getting this
anyway.
|
|
Use the generic algorithms to provide implementations for these
routines.
|
|
|
|
Musl commit 97e9b73d59 ("math: new software sqrt") adds a new algorithm
using Goldschmidt division. Port this algorithm to Rust and make it
generic, which shows a notable performance improvement over the existing
algorithm.
This also allows adding square root routines for `f16` and `f128`.
|
|
Any architecture-specific float operations are likely to consist of only
a few instructions, but the softfloat implementations are much more
complex. Ensure this is what gets tested.
|
|
`cc` automatically reads this from Cargo's `OPT_LEVEL` variable so we
don't need to set it explicitly. Remove this so running in a debugger
makes more sense.
|
|
|
|
This download has occasionally been failing in CI recently. Add a retry
so this is less likely to cause the workflow to fail.
|
|
|
|
|