about summary refs log tree commit diff
path: root/library/compiler-builtins
AgeCommit message (Collapse)AuthorLines
2025-07-18Merge ref '82310651b93a' from rust-lang/rustThe rustc-josh-sync Cronjob Bot-0/+2
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 82310651b93a594a3fd69015e1562186a080d94c Filtered ref: e13c0be8f13737c64082b89ce834546079767ac4 This merge was created using https://github.com/rust-lang/josh-sync.
2025-07-18Prepare for merging from rust-lang/rustThe rustc-josh-sync Cronjob Bot-1/+1
This updates the rust-version file to 82310651b93a594a3fd69015e1562186a080d94c.
2025-07-18Change the `memcmp` and `bcmp` return type to `c_int`Julien THILLARD-4/+5
Fix the return type of `memcmp` and `bcmp` builtin functions on targets with a `c_int` other than `i32`. Linked issue: https://github.com/rust-lang/rust/issues/144076
2025-07-18mem: Use `core::ffi::c_int`Trevor Gross-8/+1
This alias was added in 9897bfb8a ("Fix memset arguments for MSP430 target"), which predates `core::ffi`. Now that it exists we can just use `core::ffi::c_int`.
2025-07-17Update the `no-merges` PR titleJakub Beránek-1/+1
Match the new CI-created PRs: https://github.com/rust-lang/compiler-builtins/pull/974.
2025-07-17Allow a new lint failure in nightlyTrevor Gross-0/+2
```text warning: function `f32_to_bits` is never used --> libm/src/math/support/float_traits.rs:367:14 | 367 | pub const fn f32_to_bits(x: f32) -> u32 { | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: function `f64_to_bits` is never used --> libm/src/math/support/float_traits.rs:381:14 | 381 | pub const fn f64_to_bits(x: f64) -> u64 { | ^^^^^^^^^^^ warning: `libm` (lib) generated 2 warnings ``` This is a false positive, see RUST-144060.
2025-07-12Tell triagebot to reopen bot PRs to run CI on themJakub Beránek-0/+3
2025-07-12Add CI workflow for automatically performing subtree sync pullsJakub Beránek-0/+23
This CI workflow will run the https://github.com/rust-lang/josh-sync tool on Mondays and Thursdays. It will try to do a pull (sync stdarch changes from rust-lang/rust into this repository). When it runs, three things can happen: - There are no rustc changes to be pulled, the bot does nothing. - There are some new changes to be pulled. In that case, the bot will either open or update an existing PR titled "Rustc pull update" on this repository with the changes. After the PR is merged, we should ideally do the opposite sync (push) manually. - The pull fails (usually because of a merge conflict), or the bot determines that a pull PR has been opened for more than a week without being merged. In that case, it will post a ping to https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/compiler-builtins.20subtree.20sync.20automation/with/528482375.
2025-07-10Upgrade `iai-callgrind` to 0.15Trevor Gross-3/+3
Pick up the latest version of iai-callgrind, which includes some output improvements. Changelog: https://github.com/iai-callgrind/iai-callgrind/releases
2025-07-10Upgrade dependencies to the latest versionTrevor Gross-4/+4
This picks up a fix in `rustc_apfloat` [1] that resolves a problem with `fma`. [1]: https://github.com/rust-lang/rustc_apfloat/releases/tag/rustc_apfloat-v0.2.3%2Bllvm-462a31f5a5ab
2025-07-10Rollup merge of #143660 - cuviper:lib-doc-false, r=tgross35Matthias Krüger-0/+2
Disable docs for `compiler-builtins` and `sysroot` Bootstrap already had a manual doc filter for the `sysroot` crate, but other library crates keep themselves out of the public docs by setting `[lib] doc = false` in their manifest. This seems like a better solution to hide `compiler-builtins` docs, and removes the `sysroot` hack too. Fixes rust-lang/rust#143215 (after backport) ```@rustbot``` label beta-nominated
2025-07-10Add documentation about subtree syncJakub Beránek-0/+9
2025-07-08Disable docs for `compiler-builtins` and `sysroot`Josh Stone-0/+2
Bootstrap already had a manual doc filter for the `sysroot` crate, but other library crates keep themselves out of the public docs by setting `[lib] doc = false` in their manifest. This seems like a better solution to hide `compiler-builtins` docs, and removes the `sysroot` hack too.
2025-07-08Add josh-sync config fileJakub Beránek-0/+3
2025-07-08Remove josh-sync crateJakub Beránek-455/+0
2025-07-04Test building custom targets and resolve an issue probing `rustc`Trevor Gross-6/+63
The `rustc` probe done in our build scripts needs to pass `--target` to get the correct configuration, which usually comes from the `TARGET` environment variable. However, for targets specified via a `target.json` file, `TARGET` gets set to the file name without an extension or path. `rustc` will check a search path to attempt to locate the file, but this is likely to fail since the directory where Cargo invokes build scripts (and hence where those scripts invoke `rustc`) might not have any relation to the JSON spec file. Resolve this for now by leaving `f16` and `f128` disabled if the `rustc` command fails. Result of the discussion at CARGO-14208 may eventually provide a better solution. A CI test is also added since custom JSON files are an edge case that could fail in other ways. I verified this fails without the fix here. The JSON file is the output for `thumbv7em-none-eabi`, just renamed so `rustc` doesn't identify it.
2025-07-04Remove unused custom target JSON filesTrevor Gross-110/+0
8521530f4938 ("Fix __divsi3 and __udivsi3 on thumbv6m targets") removed tests that use these `thumb*-linux` target files in favor of tests that use the `thumb*-none` targets, which are available via Rustup. The JSON files haven't been used since then and are outdated, so remove them.
2025-07-04symcheck: Improve diagnostics from spawned CargoTrevor Gross-7/+22
Rather than printing the entire JSON dump, use the rendered version.
2025-07-04symcheck: Make `target` a positional argumentTrevor Gross-29/+35
This makes it more obvious what we intend to check rather than looking for `--target`.
2025-07-04Remove the `let_chains` feature now that it is stableTrevor Gross-2/+0
2025-07-02Use the compiler to determine whether or not to enable `f16` and `f128`Trevor Gross-111/+66
Currently we whether or not to build and test `f16` and `f128` support mostly based on the target triple. This isn't always accurate, however, since support also varies by backend and the backend version. Since recently, `rustc` is aware of this with the unstable config option `target_has_reliable_{f16,f128}`, which better represents when the types are actually expected to be available and usable. Switch our compiler-builtins and libm configuration to use this by probing `rustc` for the target's settings. A few small `cfg` fixes are needed with this.
2025-07-01libm: Improved integer utilities, implement shifts and bug fixes for i256 ↵quaternic-60/+223
and u256 `i256` and `u256` - operators now use the same overflow convention as primitives - implement `<<` and `-` (previously just `>>` and `+`) - implement `Ord` correctly (the previous `PartialOrd` was broken) - correct `i256::SIGNED` to `true` The `Int`-trait is extended with `trailing_zeros`, `carrying_add`, and `borrowing_sub`.
2025-06-30josh-sync: Replace `#xxxx`-style links in messagesTrevor Gross-0/+31
Often our short summaries will pick up a Bors "Auto merge of #xxxx ...` commit message. Replace these with something like `rust-lang/rust#1234` to avoid broken links when going between repositories.
2025-06-29apply suggestions for clippy::manual_is_multiple_of in libm-testquaternic-3/+3
2025-06-24Use `asm_cfg` in `probestack`Folkert de Vries-23/+13
cc https://www.github.com/rust-lang/rust/issues/140364
2025-06-14symcheck: Add a wrapper around an archiveTrevor Gross-24/+80
Rather than re-opening the archive file for each check, add a wrapper that keeps the data in memory. Additionally, collect the `--target` argument so it can be used within this crate.
2025-06-14Add minimal triagebot configUrgau-0/+21
This PR adds a minimal `triagebot.toml` config to make contributions to this repository respect upstream rust-lang/rust conventions and avoid issues when syncing this subtree.
2025-06-14use `extern "custom"` on naked functions with a custom calling conventionFolkert de Vries-28/+19
2025-06-14use `is_multiple_of` to check if an addr is alignedFolkert de Vries-9/+9
2025-06-14Work around out-of-tree testing with a shim crateTrevor Gross-4/+77
Out-of-tree testing is broken with the most recent update from rust-lang/rust because it makes `compiler-builtins` depend on `core` by path, which isn't usually available. In order to enable testing outside of rust-lang/rust, add a new crate `builtins-shim` that uses the same source as `compiler-builtins` but drops the `core` dependency. This has replaced `compiler-builtins` as the workspace member and entrypoint for tests.
2025-06-14Merge ref 'd087f112b7d1:/library/compiler-builtins' from ↵Trevor Gross-292/+206
https://github.com/rust-lang/rust Pull recent changes from rust-lang/rust via Josh. Upstream ref: d087f112b7d1323446c7b39a8b616aee7fa56b3d Filtered ref: 2d43ce8ac022170e5383f7e5a188b55564b6566a
2025-06-14Update the upstream Rust versionTrevor Gross-1/+1
To prepare for merging from rust-lang/rust, set the version file to: d087f112b7 Auto merge of #134841 - estebank:serde-attr-4, r=wesleywiser
2025-06-14Delete `.release-plz.toml`Trevor Gross-13/+0
The config file is not needed anymore since compiler-builtins is no longer published. Removing it will resolve a CI failure.
2025-06-13Mark compiler-builtins as `publish = false`Trevor Gross-0/+1
Now that this repository is a subtree, we have no need to continue publishing `compiler-builtins`.
2025-06-13Clean up and sort manifest keysTrevor Gross-12/+7
Use a consistent ordering for top-level manifest keys, and remove those that are now redundant (`homapage` isn't supposed to be the same as `repository`, and `documentation` automatically points to docs.rs now).
2025-06-13fmaximum,fminimum: Fix incorrect result and add testsTrevor Gross-57/+392
After adding tests, the current implementation for fminimum fails when provided a negative zero and NaN as inputs: ---- math::fminimum_fmaximum_num::tests::fmaximum_num_spec_tests_f64 stdout ---- thread 'math::fminimum_fmaximum_num::tests::fmaximum_num_spec_tests_f64' panicked at libm/src/math/fminimum_fmaximum_num.rs:240:13: fmaximum_num(-0x0p+0, NaN) l: NaN (0x7ff8000000000000) r: -0.0 (0x8000000000000000) ---- math::fminimum_fmaximum_num::tests::fmaximum_num_spec_tests_f32 stdout ---- thread 'math::fminimum_fmaximum_num::tests::fmaximum_num_spec_tests_f32' panicked at libm/src/math/fminimum_fmaximum_num.rs:240:13: fmaximum_num(-0x0p+0, NaN) l: NaN (0x7fc00000) r: -0.0 (0x80000000) Add more thorough spec tests for these functions and correct the implementations. Canonicalization is also moved to a trait method to centralize documentation about what it does and doesn't do.
2025-06-13Eliminate `build.rs`-generated Aarch64 atomic macros (#951)qinghon-65/+75
Replace `build.rs` Rust generation with macros, using the unstable `${concat(...)}`. Fixes: https://github.com/rust-lang/compiler-builtins/issues/947
2025-06-10indent the probestack inline assemblyFolkert de Vries-110/+110
2025-06-10merge the sgx/fortanix `__rust_probestack` into the general `x86_64` oneFolkert de Vries-73/+23
2025-06-10use `#[naked]` for `__rust_probestack`Folkert de Vries-97/+33
2025-06-10add a fixme to use `extern_custom` when availableFolkert de Vries-0/+9
2025-06-10ci: Fix a typo that was causing a command failureTrevor Gross-1/+1
2025-06-10compiler-builtins: Remove unused `lints.rust` tableTrevor Gross-4/+0
The unexpected configs are now unused or known to `rustc` in our CI.
2025-06-09compiler-builtins: Emit `rustc-check-cfg` earlierTrevor Gross-2/+3
The `build.rs` entrypoint returns early for some targets, so emscripten and OpenBSD were not getting check-cfg set. Emit these earlier to avoid the `unexpected_cfgs` lint.
2025-06-09compiler-builtins: Specify `:r` registers for `usize`Trevor Gross-3/+3
On the ILP32 `x86_64-unknown-linux-gnux32` target, `usize` is 32 bits so there is a sub-register alignment warning. Specify the 64-bit `r` registers, which matches the current default as well as the size of the other operands in the routines.
2025-06-09compiler-builtins: Resolve `unsafe_op_in_unsafe_fn` on Arm32 AndroidTrevor Gross-10/+30
There are a few places that violate this lint, which showed up in rust-lang/rust CI (the relevent module is gated behind `kernel_user_helpers` which is only set for `armv4t`, `armv5te`, and `arm-linux-androideabi`; none of these are tested in compiler-builtins CI). Add new `unsafe { /* ... */ }` blocks where needed to address this. Some blocks should get a more thorough review of their preconditions, so their safety comments are left as `FIXME`s.
2025-06-08compiler-builtins: Fix a `rustdoc::bare-urls` errorTrevor Gross-1/+1
2025-06-08Use the in-tree `compiler-builtins`Trevor Gross-3/+1
Many of `std`'s dependency have a dependency on the crates.io `compiler-builtins` when used with the feature `rustc-std-workspace-core`. Use a Cargo patch to select the in-tree version instead. `compiler-builtins` is also added as a dependency of `rustc-std-workspace-core` so these crates can remove their crates.io dependency in the future.
2025-06-04`panic-handler`: Remove the `no_core` featureTrevor Gross-9/+3
This was introduced before `#[panic_handler]` was stable, but should no longer be needed. Additionally, we only need it for `builtins-test-intrinsics`, not as a dependency of `compiler-builtins`.
2025-06-04Merge ref 'df8102fe5f24:/library/compiler-builtins' from ↵Trevor Gross-2/+1
https://github.com/rust-lang/rust Pull recent changes from rust-lang/rust via Josh. Upstream ref: df8102fe5f24f28a918660b0cd918d7331c3896e Filtered ref: 3c30d8cb1ec24e0b8a88a5cedcf6b9bece0117d7