Commit graph

2135 commits

Author SHA1 Message Date
The rustc-josh-sync Cronjob Bot
55c229b647 Merge ref '47cd7120d9' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 47cd7120d9
Filtered ref: b5a5cb8beb5c1ac848a39bfcd0ccaad98015d017
Upstream diff: caccb4d036...47cd7120d9

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-02 11:01:27 +00:00
The rustc-josh-sync Cronjob Bot
94a62dc604 Prepare for merging from rust-lang/rust
This updates the rust-version file to 47cd7120d9.
2025-12-02 10:59:26 +00:00
Trevor Gross
93b5361202 ci: Increase the benchmark rustc version to 2025-12-01
Zerocopy (an indirect test dependency) has started requiring
recently-stabilized features, so upgrade our benchmark toolchain to
match.
2025-12-02 05:22:04 -05:00
Mads Marquart
feb1b52180
Compare against CARGO_CFG_TARGET_FAMILY in a multi-valued fashion
`cfg(target_family = "...")` can be set multiple times, and thus
`CARGO_CFG_TARGET_FAMILY` can also contain comma-separated values,
similar to `CARGO_CFG_TARGET_FEATURE`.

This allows `cargo build --target wasm32-unknown-emscripten -p
musl-math-sys` to work, and will become more important if we were to add
e.g. `cfg(target_family = "darwin")` in the future as discussed in
https://github.com/rust-lang/rust/issues/100343.
2025-10-22 09:35:20 +00:00
Folkert de Vries
261d7ebdc3
stabilize asm_cfg 2025-10-15 20:43:53 +02:00
Trevor Gross
37be71b045 Add back the unsafe for intrinsics::fma but allow(unused_unsafe)
Rustc commit 055e05a338 / builtins commit 2fb3a1871bc9 ("Mark float
intrinsics with no preconditions as safe") changed `fma` and other
intrinsics to not be unsafe to call. Unfortunately we can't remove the
`unsafe` just yet since the rustc we pin for benchmarks is older than
this.

Add back `unsafe` but allow it to be unused.
2025-09-25 20:03:55 +00:00
The rustc-josh-sync Cronjob Bot
374d677c54 Merge ref 'caccb4d036' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: caccb4d036
Filtered ref: 3074203aaad351997a9863b04e251efa3e4b5f6e
Upstream diff: 9385c64c95...caccb4d036

This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-25 04:14:39 +00:00
The rustc-josh-sync Cronjob Bot
a7cfc82b64 Prepare for merging from rust-lang/rust
This updates the rust-version file to caccb4d036.
2025-09-25 04:12:30 +00:00
cyrgani
ee1b36a243
Remove usage of the to-be-deprecated core::f32, core::f64 items
Needed for https://github.com/rust-lang/rust/pull/146882.
2025-09-22 18:51:08 +00:00
ltdk
055e05a338 Mark float intrinsics with no preconditions as safe 2025-09-21 20:37:51 -04:00
Mads Marquart
bc57021f09
doc: Document that os_version_check.c is implemented in std
Since https://github.com/rust-lang/rust/pull/138944.
2025-09-13 12:55:11 -04:00
Taiki Endo
3220121a33
ci: Use nextest on PowerPC64LE and s390x
See https://github.com/taiki-e/install-action/issues/1056 for the
context.
2025-09-10 16:22:44 -04:00
Trevor Gross
b2aa2200aa symcheck: Support both archives and object files
If parsing as an archive is unsuccessful, try parsing as an object
instead before erroring out.
2025-09-07 04:55:27 -04:00
Trevor Gross
641fc3f092 symcheck: Allow checking a standalone archive
Provide an option to check without invoking Cargo first.
2025-09-07 04:52:09 -04:00
quaternic
04909ba40a
libm: define and implement trait NarrowingDiv for unsigned integer division
New utility in `libm::support`:
- `trait NarrowingDiv` for dividing `u2N / uN` when the quotient fits in
  `uN`
- a reasonable implementation of that for primitives up to `u256 / u128`

This is the inverse operation of unsigned widening multiplication:

    let xy: u256 = u128::widen_mul(x, y);
    assert_eq!(xy.checked_narrowing_div_rem(y), Some((x, 0))); // unless y == 0

The trait API is based on x86's `div`-instruction: quotient overflow
happens exactly when the high half of the dividend is greater or equal
to the divisor, which includes division by zero.
2025-09-05 09:54:37 +00:00
The rustc-josh-sync Cronjob Bot
4c4ef5ba55 Merge ref '9385c64c95' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 9385c64c95
Filtered ref: c6ec0de6a92442437c800b4a207ace45d0f6c745

This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-04 04:07:51 +00:00
The rustc-josh-sync Cronjob Bot
35270f8557 Prepare for merging from rust-lang/rust
This updates the rust-version file to 9385c64c95.
2025-09-04 04:07:46 +00:00
Matthias Krüger
0e28b4201a
Rollup merge of #144443 - WaffleLapkin:integer-target-pointer-width, r=Noratrieb
Make target pointer width in target json an integer

r? Noratrieb
cc `@RalfJung` (https://github.com/rust-lang/rust/pull/142352/files#r2230380120)

try-job: x86_64-rust-for-linux
2025-08-31 13:40:34 +02:00
The rustc-josh-sync Cronjob Bot
e36d827a4e Merge ref 'd36f964125' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: d36f964125
Filtered ref: 92461731ae79cfe5044e4826160665b77c0363a2

This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-28 04:13:43 +00:00
The rustc-josh-sync Cronjob Bot
202eb0b375 Prepare for merging from rust-lang/rust
This updates the rust-version file to d36f964125.
2025-08-28 04:11:40 +00:00
Waffle Lapkin
6a3187af13
fix target-pointer-width in tests 2025-08-27 23:44:49 +02:00
Paul Murphy
64cbe52849 Allow linking a prebuilt optimized compiler-rt builtins library
Extend the <target>.optimized-compiler-builtins bootstrap option to accept a
path to a prebuilt compiler-rt builtins library, and update compiler-builtins
to enable optimized builtins without building compiler-rt builtins.
2025-08-25 16:08:35 -05:00
Stefan Schindler
ca7a0aff74
Fix some typos 2025-08-19 23:03:18 +00:00
Trevor Gross
ba5def8a85 Add __addhf3, __subhf3, __mulhf3, __{eq,ge,gt,le,lt,ne,unord}hf2
LLVM does not currently emit these, but it is being discussed as an
option on platforms where `f32` is not hardware supported. Glibc/libgcc
also has the comparison functions [1] already.

The generic implementations for addition, subtraction, and
multiplication work for f16 without any complications, as do
comparisons, so add them here.

[1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=6ec6c77867af4ddfec7323e0ac6ede89effca852
2025-08-09 15:47:10 -05:00
Trevor Gross
531d5aa593 symcheck: Skip __ymm@ symbols on Windows
Like `__real@`, and `__xmm@`, Windows can emit duplicate `__ymm@`
symbols for constants.
2025-08-09 15:47:10 -05:00
The rustc-josh-sync Cronjob Bot
bf8487827d Merge ref 'ffb9d94dcf' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: ffb9d94dcf
Filtered ref: 2f31646593733abae36e4c05b5a54acfb9f1f6bc

This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-09 01:55:44 +00:00
The rustc-josh-sync Cronjob Bot
3fb62b990c Prepare for merging from rust-lang/rust
This updates the rust-version file to ffb9d94dcf.
2025-08-09 01:53:44 +00:00
Trevor Gross
0a1e0c65ec
Rollup merge of #144974 - tgross35:update-builtins, r=tgross35
compiler-builtins subtree update

Subtree update of `compiler-builtins` to 87a66ec969.

Created using https://github.com/rust-lang/josh-sync.

r? ``@ghost``
2025-08-07 19:36:37 -05:00
Trevor Gross
9a81b2a6a0 Start runnning tests for aarch64-pc-windows-msvc
This target is currently build-only. Switch to the windows-11-arm
runner, which allows us to start running tests.
2025-08-07 15:49:49 -05:00
Trevor Gross
36ec648e0a Remove instances of allow(improper_ctypes)
i128/u128 haven't flagged `improper_ctypes` for a while, and this just
made it to stable [1]. Remove the `allow`s as they are no longer needed.

[1]: https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#i128-and-u128-in-extern-c-functions
2025-08-07 12:31:22 -05:00
Trevor Gross
ab0def2739 symcheck: Ignore symbols in .debug_gdb_scripts
Since [1], our object files may now contain a GDB script section. These
symbols wind up with multiple instances in the archive but are weak, so
we can safely ignore them in our duplicates check.

This resolves the current CI failures.

[1]: https://github.com/rust-lang/rust/pull/143679
2025-08-07 03:32:37 -05:00
Trevor Gross
decdb950bf symcheck: Store the section name in SymInfo if available
Currently `SymInfo` stores a `Section`, which is just an index:

    SymInfo {
        section: Section(
            SectionIndex(
                539,
            ),
        ),
        ...
    },

Look up and store the section name instead if possible, with a fallback
to the `Section` debug printing. This makes output more clear and will
allow us to filter by section name.
2025-08-07 03:32:34 -05:00
Trevor Gross
fbc700f92b configure: Use CARGO_CFG_*_{F16,F128} rather than invoking rustc
Currently we run the `rustc` from the `RUSTC` environment variable to
figure out whether or not to enable `f16` and `f128`, based on the
`target_has_reliable_{f16,f128}` config. However, this does not know
about the codegen backend used, and the backend isn't trivial to check
in a build script (usually it gets set via `RUSTFLAGS`).

It turns out we don't actually need to run `rustc` here: Cargo
unconditionally emits all config from the relevant compiler as
`CARGO_CFG_*` variables, regardless of whether or not they are known
options. Switch to checking these for setting config rather than
invoking `rustc`.

As an added advantage, this will work with target.json files without any
special handling.

Fixes: ed17b95715dd ("Use the compiler to determine whether or not to enable `f16` and `f128`")
2025-08-05 21:17:03 +00:00
Paul Murphy
3b50253b57 compiler-builtins: plumb LSE support for aarch64 on linux
Add dynamic support for aarch64 LSE atomic ops on linux targets
when optimized-compiler-builtins is not enabled.

A hook, __enable_rust_lse, is provided for the runtime to enable
them if available. A future patch will use this to enable them
if available.

The resulting asm should exactly match that of LLVM's compiler-rt
builtins, though the symbol naming for the support function and
global does not.
2025-08-05 10:30:38 -05:00
Trevor Gross
ecf6d3c6ce Simplify the configuration for no-panic
Currently, attributes for `no-panic` are gated behind both the `test`
config and `assert_no_panic`, because `no-panic` is a dev dependency (so
only available with test configuration). However, we only emit
`assert_no_panic` when the test config is also set anyway, so there
isn't any need to gate on both.

Replace gates on `all(test, assert_no_panic)` with only
`assert_no_panic`. This is simpler, and also has the benefit that
attempting to check for panics without `--test` errors.
2025-07-30 10:02:34 -05:00
Trevor Gross
3cbd088ee4 ci: Set pipefail before running ci-util
Currently, a failure in `ci-util.py` does not cause the job to fail
because the pipe eats the failure status . Set pipefail to fix this.

Fixes: ff2cc0e38e3e ("ci: Don't print output twice in `ci-util`")
2025-07-30 09:57:45 -05:00
Trevor Gross
4ebfdf74db ci: Add a way to run libm tests that would otherwise be skipped
Introduce a new directive `ci: test-libm` to ensure tests run.
2025-07-30 08:59:57 +00:00
Trevor Gross
c045c9b1ca ci: Commonize the way PrInfo is loaded from env 2025-07-30 08:59:57 +00:00
Trevor Gross
eafafc44ab ci: Don't print output twice in ci-util
Use `tee` rather than printing to both stdout and stderr.
2025-07-30 08:59:57 +00:00
Trevor Gross
ab8a2e1cb2 ci: Switch to strongly typed directives
Replace the current system with something that is more structured and
will also catch unknown directives.
2025-07-30 08:59:55 +00:00
Trevor Gross
97c35d3aed ci: Simplify tests for verbatim paths
Rather than setting an environment variable in the workflow job based on
whether or not the environment is non-MinGW Windows, we can just check
this in the ci script.

This was originally added in b0f19660f0 ("Add tests for UNC paths on
windows builds") and its followup commits.
2025-07-29 19:07:55 +00:00
Trevor Gross
54a4f867f8 cleanup: Trim trailing whitespace 2025-07-29 18:56:46 +00:00
Jakub Beránek
54f6ab73b1
Switch to using a GH app for authenticating sync PRs
So there will no longer be the need to close and reopen sync PRs in
order for CI to run.
2025-07-29 08:20:22 +00:00
Trevor Gross
16cb37c957 Remove no-asm gating when there is no alternative implementation
Assembly-related configuration was added in 1621c6dbf9eb ("Use
`specialized-div-rem` 1.0.0 for division algorithms") to account for
Cranelift not yet supporting assembly. This hasn't been relevant for a
while, so we no longer need to gate `asm!` behind this configuration.
Thus, remove `cfg(not(feature = "no-asm"))` in places where there is no
generic fallback.

There are other cases, however, where setting the `no-asm` configuration
enables testing of generic version of builtins when there are platform-
specific implementations available; these cases are left unchanged. This
could be improved in the future by exposing both versions for testing
rather than using a configuration and running the entire testsuite
twice.

This is the compiler-builtins portion of
https://github.com/rust-lang/rust/pull/144471.
2025-07-27 16:39:31 -05:00
Folkert de Vries
9c683d3487
Implement floor and ceil in assembly on i586
Fixes: https://github.com/rust-lang/compiler-builtins/issues/837

The assembly is based on

- 2043392793/lib/libm/arch/i387/s_floor.S
- 2043392793/lib/libm/arch/i387/s_ceil.S

Which both state

    /*
     * Written by J.T. Conklin <jtc@NetBSD.org>.
     * Public domain.
     */

Which I believe means we're good in terms of licensing.
2025-07-27 17:27:40 -04:00
quaternic
c061e73d9f
Avoid inlining floor into rem_pio2
Possible workaround for
https://github.com/rust-lang/compiler-builtins/pull/976#issuecomment-3085530354

Inline assembly in the body of a function currently causes the compiler
to consider that function possibly unwinding, even if said asm
originated from inlining an `extern "C"` function. This patch wraps the
problematic callsite with `#[inline(never)]`.
2025-07-27 00:26:58 -05:00
Trevor Gross
474315828b libm: Update for new warn-by-default clippy lints
Silence the approximate constant lint because it is noisy and not always
correct. `single_component_path_imports` is also not accurate when built
as part of `compiler-builtins`, so that needs to be `allow`ed as well.
2025-07-26 20:21:35 -05:00
Trevor Gross
9dad77f337 Use x86_no_sse configuration in more places
Emit `x86_no_sse` in the compiler-builtins (and builtins-test) build
script, and use it to simplify `all(target_arch = "x86",
not(target_fefature = "sse))` configuration.
2025-07-24 19:37:45 +00:00
Trevor Gross
0b6c1d3861 Enable skipped f32 and f64 multiplication tests
The fix has since made it to nightly, so the skips here can be removed.
2025-07-24 18:49:50 +00:00
Trevor Gross
b168793046 Enable tests that were skipped on aarch64
The LLVM issue was resolved a while ago, these should no longer be a
problem.
2025-07-24 18:49:50 +00:00