Skip to content

compiler-builtins subtree update#155653

Merged
rust-bors[bot] merged 120 commits intorust-lang:mainfrom
folkertdev:compiler-builtins-sync-2026-04-22
Apr 24, 2026
Merged

compiler-builtins subtree update#155653
rust-bors[bot] merged 120 commits intorust-lang:mainfrom
folkertdev:compiler-builtins-sync-2026-04-22

Conversation

@folkertdev
Copy link
Copy Markdown
Contributor

Subtree update of compiler-builtins to rust-lang/compiler-builtins@4d3ab86.

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

cc @tgross35 if this is not a good time to sync, but it looks like it's been a while and this should specifically close #153772

r? @ghost

tgross35 and others added 30 commits March 15, 2026 17:30
The described issue in the reverted commit is no longer relevant.

This reverts commit 870ab266bad7ec0a56abfc433f92e3c2d67a572c.
…publishing

publish via trusted publishing
Resolve the following lints:

* `unpinned-uses`: Pin action versions using `zizmor --fix`
* `excessive-permissions`: Add `permissions: {}` to all workflows
* `template-injection`: This one wasn't too concerning since `${{ ...
  }}` was only used for `matrix` and `needs` access, but it is easy
  enough to resolve by storing in an environment variable.
Resolve two cases of `ref-version-mismatch` and various `artipacked`
instances.
Use the same trick as with other formatting implementations, which makes
it possible to get rid of the awkward `-> String` functions.
Add wrappers for compiler-builtins that closer match the libm
interfaces, and add basic compiler-builtins float arithmetic to the set
of tested functions.

This means we now get tests against MPFR, better edge case coverage,
extensive testing, and benchmarks for the following functions:

* `__add[hsdt]f3`
* `__sub[hsdt]f3`
* `__mul[hsdt]f3`
* `__div[sdt]f3`
* `__powi[sdt]f2`

Functions from compiler-builtins have not yet been tied in with
`update-api-list.py` and the CI tooling that reads it, that will need to
be updated in a follow up.
Add the following to our larger test infrastructure:

* `__eq[hsdf]2`
* `__ne[hsdf]2`
* `__unord[hsdf]2`
* `__lt[hsdf]2`
* `__le[hsdf]2`
* `__gt[hsdf]2`
* `__ge[hsdf]2`
Add the following to the test infrastructure:

* `__extenddftf2`
* `__extendhfdf2`
* `__extendhfsf2`
* `__extendhftf2`
* `__extendsfdf2`
* `__extendsftf2`
* `__truncdfhf2`
* `__truncdfsf2`
* `__truncsfhf2`
* `__trunctfdf2`
* `__trunctfhf2`
* `__trunctfsf2`
Wire up benchmarks for functions that are now part of our testing
infrastructure.
Create a new struct `Hex` that serves all of these purposes via a new
trait `DisplayHex`. This is easier to work with because we can make
`DisplayHex` a bound of `Float`.
This allows us to use a single base name for functions that have
multiple types in the signature, such as `extend_f32_f64`.

The compiler-builtins `trunc` operation wrappers had to be renamed to
`narrow` to avoid conflicting with libm `trunc`.
Add the following to the test infrastructure:

* `__fixdfdi`
* `__fixdfsi`
* `__fixdfti`
* `__fixsfdi`
* `__fixsfsi`
* `__fixsfti`
* `__fixtfdi`
* `__fixtfsi`
* `__fixtfti`
* `__fixunsdfdi`
* `__fixunsdfsi`
* `__fixunsdfti`
* `__fixunssfdi`
* `__fixunssfsi`
* `__fixunssfti`
* `__fixunstfdi`
* `__fixunstfsi`
* `__fixunstfti`
The .dockerenv check was a workaround for Docker CI where the
checkout is mounted read-only. However, its presence does not reliably
indicate that the filesystem is unwritable.

Use CARGO_TARGET_DIR as the condition instead, which directly
captures when a custom writable target directory is in use and avoids
false assumptions.
There isn't anything special about its implementation, so make it normal
code to clean some things up.
Make it possible to access each argument without relying on `FTy`.
We can always access individual arguments rather than relying on the
common `FTy` type. This is a cleaner design anyway since it handles
functions with integers in the signature better.
Now that tests have moved to using argument types instead of a whole-
function float type, remove `FTy` and its relevant configuration. This
will make it possible to use the same infrastructure for functions that
don't have any floats as arguments, or don't have any at all.

Some uses of `FTy` have been replaced with the `Group` enum, e.g. for
match arm patterns and selecting extensive tests. Anything that doesn't
have float types in the signature will be in the `Integer` category.
@tgross35
Copy link
Copy Markdown
Contributor

Wow that's a lot of commits since the last sync. Feel free to poke me on these if you're waiting on something, didn't realize it had been so long.

Hmm, the compilation complains about the mem feature not being available. Looks like the comment was updated but then the feature was removed in

2257936#diff-3a38a19226bdfa7d6023644ec99a02fe6326602d053283e44aac342ee74a50af

does it need to be added back, or should we remove uses of it?

Could you add a commit adding it back to library/compiler-builtins/compiler-builtins/Cargo.toml under the comment? That's the manifest that gets used in r-l/r and should match library/compiler-builtins/builtins-shim/Cargo.toml, but looks like I messed it up there.

this was removed by accident before, and only discovered now that we're syncing with the main repo
@folkertdev
Copy link
Copy Markdown
Contributor Author

Wow that's a lot of commits since the last sync.

I think it's mostly bookkeeping for that repo, so it looks like more than it actually is. But there are some useful fixes in there.

Could you add a commit adding it back to library/compiler-builtins/compiler-builtins/Cargo.toml under the comment?

Done, hopefully that is sufficient (please r+ if this passes CI, otherwise I'll get back to it in the morning)

@tgross35
Copy link
Copy Markdown
Contributor

Yeah I've been doing a ton of testing changes there recently, not so much implementation work. Still just has to be a record for the count and for the +/-.

Done, hopefully that is sufficient (please r+ if this passes CI, otherwise I'll get back to it in the morning)

Will do, was already planning on it 👍

Copy link
Copy Markdown
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 22, 2026

📌 Commit ca43552 has been approved by tgross35

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 22, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 23, 2026
… r=tgross35

compiler-builtins subtree update

Subtree update of `compiler-builtins` to rust-lang/compiler-builtins@4d3ab86.

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

cc @tgross35 if this is not a good time to sync, but it looks like it's been a while and this should specifically close #153772

r? @ghost
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job dist-various-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   |
38 | #[cfg(mem_unaligned)]
   |       ^^^^^^^^^^^^^
   |
   = help: expected names are: `__aarch64_cas16_acq`, `__aarch64_cas16_acq_rel`, `__aarch64_cas16_rel`, `__aarch64_cas16_relax`, `__aarch64_cas1_acq`, `__aarch64_cas1_acq_rel`, `__aarch64_cas1_rel`, `__aarch64_cas1_relax`, `__aarch64_cas2_acq`, `__aarch64_cas2_acq_rel`, `__aarch64_cas2_rel`, `__aarch64_cas2_relax`, `__aarch64_cas4_acq`, `__aarch64_cas4_acq_rel`, `__aarch64_cas4_rel`, `__aarch64_cas4_relax`, `__aarch64_cas8_acq`, `__aarch64_cas8_acq_rel`, `__aarch64_cas8_rel`, `__aarch64_cas8_relax`, `__aarch64_ldadd1_acq`, `__aarch64_ldadd1_acq_rel`, `__aarch64_ldadd1_rel`, `__aarch64_ldadd1_relax`, `__aarch64_ldadd2_acq`, `__aarch64_ldadd2_acq_rel`, `__aarch64_ldadd2_rel`, `__aarch64_ldadd2_relax`, `__aarch64_ldadd4_acq`, `__aarch64_ldadd4_acq_rel`, `__aarch64_ldadd4_rel`, `__aarch64_ldadd4_relax`, `__aarch64_ldadd8_acq`, `__aarch64_ldadd8_acq_rel`, and `__aarch64_ldadd8_rel` and 132 more
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mem_unaligned)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(mem_unaligned)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition name: `mem_unaligned`
  --> /rustc/8c8061eb41ac30d99092f067fa93b30212a034ab/library/compiler-builtins/compiler-builtins/src/mem/impls.rs:49:11
   |
49 | #[cfg(not(mem_unaligned))]
   |           ^^^^^^^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mem_unaligned)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(mem_unaligned)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `mem_unaligned`
  --> /rustc/8c8061eb41ac30d99092f067fa93b30212a034ab/library/compiler-builtins/compiler-builtins/src/mem/impls.rs:69:11
   |
69 | #[cfg(not(mem_unaligned))]
   |           ^^^^^^^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mem_unaligned)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(mem_unaligned)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `mem_unaligned`
  --> /rustc/8c8061eb41ac30d99092f067fa93b30212a034ab/library/compiler-builtins/compiler-builtins/src/mem/impls.rs:91:11
   |
91 | #[cfg(not(mem_unaligned))]
   |           ^^^^^^^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mem_unaligned)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(mem_unaligned)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `mem_unaligned`
   --> /rustc/8c8061eb41ac30d99092f067fa93b30212a034ab/library/compiler-builtins/compiler-builtins/src/mem/impls.rs:139:15
    |
139 |     #[cfg(not(mem_unaligned))]
    |               ^^^^^^^^^^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mem_unaligned)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(mem_unaligned)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `mem_unaligned`
   --> /rustc/8c8061eb41ac30d99092f067fa93b30212a034ab/library/compiler-builtins/compiler-builtins/src/mem/impls.rs:188:11
    |
188 |     #[cfg(mem_unaligned)]
    |           ^^^^^^^^^^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mem_unaligned)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(mem_unaligned)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `mem_unaligned`
   --> /rustc/8c8061eb41ac30d99092f067fa93b30212a034ab/library/compiler-builtins/compiler-builtins/src/mem/impls.rs:255:15
    |
255 |     #[cfg(not(mem_unaligned))]
    |               ^^^^^^^^^^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mem_unaligned)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(mem_unaligned)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `mem_unaligned`
   --> /rustc/8c8061eb41ac30d99092f067fa93b30212a034ab/library/compiler-builtins/compiler-builtins/src/mem/impls.rs:304:11
    |
304 |     #[cfg(mem_unaligned)]
    |           ^^^^^^^^^^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mem_unaligned)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(mem_unaligned)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

   Compiling rustc-std-workspace-core v1.99.0 (/checkout/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/checkout/library/alloc)
[RUSTC-TIMING] rustc_std_workspace_core test:false 0.036

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 23, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 23, 2026

💔 Test for 8c8061e failed: CI. Failed job:

@tgross35
Copy link
Copy Markdown
Contributor

I'll have a patch ready shortly

@tgross35
Copy link
Copy Markdown
Contributor

I can't push this branch, testing in #155709

rust-bors Bot pushed a commit that referenced this pull request Apr 24, 2026
@rust-bors rust-bors Bot closed this in ec6f9a5 Apr 24, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 24, 2026
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 24, 2026
@rust-bors rust-bors Bot merged commit ca43552 into rust-lang:main Apr 24, 2026
11 of 12 checks passed
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 24, 2026

This pull request was unapproved due to being closed.

renovate-bot pushed a commit to renovate-bot/rust-lang-_-compiler-builtins that referenced this pull request Apr 26, 2026
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 27, 2026
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Apr 30, 2026
@cuviper cuviper added this to the 1.97.0 milestone Apr 30, 2026
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request May 4, 2026
pull Bot pushed a commit to Kokoro2336/rust-analyzer that referenced this pull request May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support __mulsi3 for m68k