Commit Graph

28030 Commits

Author SHA1 Message Date
Folkert de Vries ca43552c13 add the mem feature back to compiler-builtins/Cargo.toml
this was removed by accident before, and only discovered now that we're syncing with the main repo
2026-04-23 00:59:32 +02:00
Trevor Gross 90a0227843 support: Update vendored cfg-if to upstream for true and false support
Link: https://github.com/rust-lang/cfg-if/commit/15aec4a67e633254e726bf477b8b86c65687bfc6
2026-04-20 07:08:20 -04:00
Trevor Gross 996b57d5bc test: Fix printing bitwise float reprs in error printing
In commit "test: Consolidate `Hexf`, `Hexi`, and the `Hex` trait" we
unintentionally lost the difference between float hex and bitwise hex
formatting; instead, the float hex was getting printed twice. Resolve
this by printing the integer hex whenever the `-` format modifier is
specified.  This also makes things simpler because we no longer need to
keep track of whether an `impl DisplayHex` is a float with `.to_bits()`
available or an integer without it, we can always just try to print both
forms.

As a result, we can use a common error message for all validation
checks.
2026-04-18 23:51:56 -04:00
Daniel Scherzer 0cc3a7d6fe c-b: add missing word in src/mem/impls.rs docs 2026-04-18 21:42:33 -04:00
Trevor Gross 5d4b1764c1 bench: Use a group with many benches rather than many groups 2026-04-16 18:18:54 -04:00
Spxg dcb70deadf Fix the type of CmpResult on wasm64
resolve rust-lang/compiler-builtins#1199
2026-04-16 17:27:08 -04:00
gamma0987 32ccc13554 fix: Remove duplicate icount_bench_gef128_group in libm-test benches 2026-04-16 14:03:15 -04:00
Trevor Gross c7c1c1a8d0 c-b: Better document where CmpResult comes from 2026-04-16 13:52:11 -04:00
Mend Renovate b61f1716c7 chore(deps): update rust crate gungraun to 0.18.0 2026-04-16 13:44:34 -04:00
Trevor Gross b2877ac70d ci: Exclude update-api-list from libm tests 2026-04-16 05:24:29 -04:00
Mend Renovate fd47f70790 chore(deps): update rust crate rand to v0.10.1 [security] 2026-04-14 01:19:53 -04:00
Trevor Gross 3af9faa6cd test: Move tidy_lists from update-api-list.py to a new crate
This is the first step of migrating `update-api-list.py` to something
that handles the compiler-builtins functions.
2026-04-10 06:30:25 -04:00
Trevor Gross 5c66a58083 hex: Always print a leading + sign and the NaN payload
This is for debugging so always give us all useful output.
2026-04-09 21:02:32 -04:00
Trevor Gross c2c30c9037 hex: Eliminate parser hacks needed for the previous MSRV 2026-04-09 21:02:32 -04:00
Brian Cain a4fe265df0 hexagon: Implement __clear_cache using inline assembly
Implement `__clear_cache` for Hexagon targets in Rust. Hexagon has
separate instruction and data caches, so this flushes dirty data cache
lines with `dccleaninva`, invalidates stale instruction cache lines
with `icinva`, then issues an `isync` barrier.

Based on the compiler-rt implementation from
llvm/llvm-project#188411.
2026-04-09 20:10:55 -04:00
Trevor Gross a6de51188b libm: Add tests against rug for i256 2026-04-09 20:05:51 -04:00
Trevor Gross 06ea8566a1 libm: Add basic tests for u256::shl
Duplicate the shr test style to have a simple check for edge cases.
2026-04-09 20:05:51 -04:00
The rustc-josh-sync Cronjob Bot 6ea1978117 Merge ref 'd0442e2800d3' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@d0442e2800
Filtered ref: rust-lang/compiler-builtins@9ead3e918f
Upstream diff: https://github.com/rust-lang/rust/compare/0e95a0f4c677002a5d4ac5bc59d97885e6f51f71...d0442e2800d356ae282ddcdbe0eff8798fe648b6

This merge was created using https://github.com/rust-lang/josh-sync.
2026-04-09 04:58:31 +00:00
The rustc-josh-sync Cronjob Bot 5fd302043b Prepare for merging from rust-lang/rust
This updates the rust-version file to d0442e2800.
2026-04-09 04:56:10 +00:00
Jake Goulding eef4363403 Clarify that core::range::{Range,RangeFrom,RangeToInclusive} do not have special syntax
I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.
2026-04-08 14:05:12 -04:00
Jake Goulding 092f0ca1bd Clarify that core::range::RangeInclusive does not have special syntax
I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.
2026-04-08 14:02:37 -04:00
Jonathan Brouwer 532c2b64d8 Rollup merge of #154778 - BennoLossin:frt-invariant, r=oli-obk
make field representing types invariant over the base type

We probably don't want to have any subtype relationship between any FRTs.

Reported-by: @dvdhrm "David Rheinsberg" <david@readahead.eu>
Link: https://rust-for-linux.zulipchat.com/#narrow/channel/288089-General/topic/Multiple.20LockedBy.20with.20Single.20Lock/near/579275908

r? @oli-obk
2026-04-08 14:22:02 +02:00
Jonathan Brouwer c8b04b6468 Rollup merge of #151898 - Randl:const-double-iter, r=oli-obk
constify DoubleEndedIterator

The only functions that can't be constified are `advance_back_by` (requires const range or const-hack), `nth_back` (requires `advance_back_by`), and `rfind` (requires const closures).

I've put it under `const_iter`, but I can open a separate tracking issue, though I think tracking all `Iterator` traits separately would be quite annoying, and we probably would prefer to constify them together anyway.
2026-04-08 14:21:59 +02:00
bors c753cef0df Auto merge of #154976 - jhpratt:rollup-e8XWRVU, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#154460 (Deduplication: Pulled common logic out from lower_const_arg_struct)
 - rust-lang/rust#154609 (Enable `#[diagnostic::on_const]` for local impls)
 - rust-lang/rust#154678 (Introduce #[diagnostic::on_move] on `Rc`)
 - rust-lang/rust#154902 (rustdoc: Inherit inline attributes for declarative macros)
2026-04-08 05:22:42 +00:00
Jacob Pratt 3be7b83ddc Rollup merge of #154678 - rperier:diagnostic_on_move_for_the_rc_type, r=tgross35
Introduce #[diagnostic::on_move] on `Rc`

This is related to the tracking issue rust-lang/rust#154181 and to the original issue rust-lang/rust#149862.
2026-04-07 23:05:31 -04:00
bors 30d0309fa8 Auto merge of #148486 - kpreid:vec-iter-drop, r=jhpratt
Explicitly forget the zero remaining elements in `vec::IntoIter::fold()`.



[Original description:] ~~This seems to help LLVM notice that dropping the elements in the destructor of `IntoIter` is not necessary. In cases it doesn’t help, it should be cheap since it is just one assignment.~~

This PR adds a function to `vec::IntoIter()` which is used used by `fold()` and `spec_extend()`, when those operations complete, to forget the zero remaining elements and only deallocate the allocation, ensuring that there will never be a useless loop to drop zero remaining elements when the iterator is dropped.

This is my first ever attempt at this kind of codegen micro-optimization in the standard library, so please let me know what should go into the PR or what sort of additional systematic testing might indicate this is a good or bad idea.
2026-04-08 02:06:51 +00:00
Jonathan Brouwer 2895451ff3 Rollup merge of #154950 - davidtwco:scalable-no-cfg, r=RalfJung
library: no `cfg(target_arch)` on scalable intrinsics

These intrinsics don't technically need to be limited to a specific architecture, they'll probably only make sense to use on AArch64, but this just makes it harder to use them in stdarch where it is appropriate (such as on `arm64ec`): requiring a rustc patch to land and be on nightly before stdarch work can proceed. So let's just not `cfg` them at all, they're perma-unstable anyway.

Fixes CI failure in rust-lang/stdarch#2071
2026-04-07 17:26:38 +02:00
Jonathan Brouwer a96fa87ee4 Rollup merge of #154922 - tgross35:builtins-inverse-trig, r=RalfJung
c-b: Export inverse hyperbolic trigonometric functions

Since a1feab1638 ("Use libm for acosh and asinh"), the standard library may link these functions to get a more accurate approximation; however, some targets do not have the needed symbols available. Add them to the compiler-builtins export list to make sure the fallback is usable.

Closes: https://github.com/rust-lang/rust/issues/154919
2026-04-07 17:26:36 +02:00
Jonathan Brouwer 87b48159c3 Rollup merge of #154837 - moturus:motor-os-abort, r=jhpratt
library: std: motor: use OS' process::exit in abort_internal

abort_internal() is used in panics; if it calls core::intrinsics::abort(), the process triggers an invalid op code (on x86_64), which is a much harder "abort" than a user-controlled exit via a panic.

Most other OSes don't use core::intrinsics::abort() here, but either libc::abort(), or a native OS abort/exit API.
2026-04-07 17:26:34 +02:00
Jonathan Brouwer df0712da44 Rollup merge of #154825 - Lars-Schumann:non-zero-const-step, r=jhpratt
constify `Step for NonZero<u*>`

Tracking Issue: https://github.com/rust-lang/rust/issues/42168

I missed the constification of `Step for NonZero<u*>` in the recent https://github.com/rust-lang/rust/pull/153821, so here they are.

Had to constify the `Clone` / `TrivialClone` impls along the way https://github.com/rust-lang/rust/issues/142757 .
2026-04-07 17:26:33 +02:00
Jonathan Brouwer 33528612ba Rollup merge of #154795 - ZuseZ4:autodiff-general-docs, r=oli-obk
Add more info about where autodiff can be applied

It's taken quite a few years, but we finally have a PR open to distribute Enzyme: https://github.com/rust-lang/rust/pull/154754
I therefore went over the docs once more and noticed we don't explain a lot of the most basic features, which we added over the years and have since taken for granted.

@Sa4dUs, do you think there are more interesting cases that we are missing?

Generally, there's still a lot of complexity in it, especially for people who haven't used Enzyme before.
To some extent, that's just a result of my general design goal to expose all performance-relevant features of Enzyme, and let users explore nice abstractions on top if it, via crates. Since we don't have those nightly users yet, users haven't had time to build nicer abstractions on top of it.

I also feel like a more guided book would be a better first introduction to Enzyme, but for now I just focused on the list of features.

r? @oli-obk
2026-04-07 17:26:32 +02:00
Jonathan Brouwer 6ee4118299 Rollup merge of #154761 - Vastargazing:add-regression-tests-cmp-argument-order, r=jhpratt
coretests: add argument order regression tests for min_by/max_by/minmax_by

PR rust-lang/rust#136307 introduced a regression in min_by, max_by, and minmax_by:
the compare closure received arguments as (v2, v1) instead of (v1, v2),
contrary to the documented contract.
Although this was fixed in rust-lang/rust#139357, no regression tests were added.
This PR adds regression tests for all three functions, verifying that compare
always receives arguments in the documented order (v1, v2).
As a bonus: first coretests coverage for minmax_by.
2026-04-07 17:26:31 +02:00
Jonathan Brouwer bdc9dc453d Rollup merge of #154928 - guiyuanju:fix-pin-doc, r=chenyukang
Fix pin docs

Split a long sentence to improve readability.

The original sentence required multiple readings for me to understand as a non-native speaker. The revised version is clearer and more readable, and likely easier for others as well.
2026-04-07 17:26:26 +02:00
Trevor Gross cea20e0e61 ci: Increase the timeout for benchmark jobs to 30 minutes
The i686 job has sometimes hit the existing 20 minute limit when things
take an extra long time to download.
2026-04-07 08:44:34 -04:00
Trevor Gross 2df972607e build: Fix c-b builds always being marked dirty 2026-04-07 08:44:34 -04:00
Trevor Gross f5ca8e59fb build: Use a single configure file for all libraries
Some libraries already share a lot, but there is still some repeated or
scattered config. Centralize this all in `libm/configure.rs`.
2026-04-07 08:29:12 -04:00
Trevor Gross 2b288d32b5 build: Make c-b configue::Target match libm configure::Config
Rename the fields and the type use to make it easier to combine these
two structs.
2026-04-07 08:29:12 -04:00
Trevor Gross 25104546ce test: Extract flat_maps to product* functions 2026-04-07 05:58:18 -04:00
Trevor Gross bbcba28cfc test: Use a more consistent setup for iter and steps 2026-04-07 05:58:18 -04:00
David Wood 86f9e83b2d intrinsics: no cfg(target_arch) on scalable
These intrinsics don't technically need to be limited to a specific
architecture, they'll probably only make sense to use on AArch64,
but this just makes it harder to use them in stdarch where it is
appropriate (such as on `arm64ec`), requiring a rustc patch to land and
be on nightly before stdarch work can proceed - so just don't `cfg` them
at all.
2026-04-07 09:41:56 +00:00
guiyuanju db373833ce Fix pin docs
Split a long sentence to improve readability.
2026-04-07 17:22:59 +08:00
Trevor Gross 5678e6187d test: Use let chains to simplify patterns in generator macros 2026-04-07 04:15:24 -04:00
Trevor Gross 5344da9654 test: Make use of strict_mul rather than checked_mul(..).unwrap() 2026-04-07 04:15:24 -04:00
Trevor Gross 73cb91db4e test: Give helper functions in spaced more accurate names 2026-04-07 04:15:24 -04:00
Trevor Gross 8930f50b96 c-b: Export inverse hyperbolic trigonometric functions
Since a1feab1638 ("Use libm for acosh and asinh"), the standard
library may link these functions to get a more accurate approximation;
however, some targets do not have the needed symbols available. Add them
to the compiler-builtins export list to make sure the fallback is
usable.
2026-04-06 23:17:13 -05:00
Trevor Gross 6bbf64e1dd roundeven: Use an assembly implementation on i586
Add an assembly implementation for roundeven which also works for
`rint`, similar to the existing `ceil` and `floor` implementations. This
resolves cases where values close to the *.5 boundary would round the
incorrect direction, such as -519629176421.49976 (tested in
`case_list`).
2026-04-06 20:57:45 -04:00
Jacob Pratt 7913288d66 Rollup merge of #154891 - WaffleLapkin:deregress-manually-drop-matching, r=JohnTitor
implement `StructuralPartialEq` for `MaybeDangling`

This fixes -- a stable-to-stable regression where constants of type `ManuallyDrop<T>` would not be allowed to be used as a pattern due to `MaybeDangling<T>` in `ManuallyDrop<T>` not implementing `StructuralPartialEq`.

Fixes https://github.com/rust-lang/rust/issues/154890

I'm sorry, @theemathas, I forgot to address your [comment](https://github.com/rust-lang/rust/pull/149614#discussion_r2587340079) 😭
2026-04-06 19:56:41 -04:00
Lars Schumann fc71bad873 de-non_const some iterator methods 2026-04-06 21:16:10 +00:00
Romain Perier 92ed4a21ff Introduce #[diagnostic::on_move] on Rc
This annotates the `Rc` type with the diagnostic attribute
`#[diagnostic::on_move]`. Now when a moved `Rc` is borrowed,
a suggestion to clone it is made, with a label explaining why.
2026-04-06 19:05:55 +02:00
Waffle Lapkin d5f98fbb27 implement StructuralPartialEq for MaybeDangling
This fixes a stable-to-stable regression where constants of type
`ManuallyDrop<T>` would not be allowed to be used as a pattern due to
`MaybeDangling<T>` in `ManuallyDrop<T>` not implementing
`StructuralPartialEq`.
2026-04-06 18:18:32 +02:00