3473 Commits

Author SHA1 Message Date
Jonathan Brouwer
f3983ba757 Rollup merge of #163918 - yilin0518:fix_arm_hint, r=JohnTitor
remove redundant unsafe

Related Zulipchat topic link: [Safety requirements of ARM hint APIs](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Safety.20requirements.20of.20ARM.20hint.20APIs/with/629609101)

This PR tries to remove the unsafe in `core_arch/arm_shared/hint.rs`. As the Zulip topic discussed, these APIs have `#[cfg(any(...))]` attribute to restrict that these can only be compiled when specific architecture is met. So there seems no need to mark these APIs unsafe.

For `__nop`, I found that in `riscv_shared` there exist the same `nop` instruction, but it is marked safe. The concrete path is `core_arch/src/riscv_shared/mod.rs`

```rust
/// Generates the `NOP` instruction
///
/// The NOP instruction does not change any architecturally visible state, except for
/// advancing the `pc` and incrementing any applicable performance counters.
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
pub fn nop() {
    unsafe {
        asm!("nop", options(nomem, nostack, preserves_flags));
    }
}
```

But there is a remaining question: For `wfe` and `wfi`, they can be configurable to trap. So I think if needed, I can complement some discription about trap. Hoping you can give me some suggestion.
2026-10-11 16:23:22 +02:00
bors
36aeef32c6 Auto merge of #156674 - xonx4l:port-stdarch-gen, r=Kobzol
bootstrap: add bootstrap step to run stdarch-gen checks in CI



This PR ports stdarch-gen checks into the bootstrap test runner as a step, so that we can run the stdarch-gen checks via x.py test.

Changes -:
-> Adds a new `StdarchGenCheck` bootstrap step.
-> Mirrors `f71ac102d3/.github/workflows/main.yml (L309-L333)` (check-stdarch-gen job) 
-> `stdarch-gen-arm` uses a nightly only feature (`#![feature(pattern)]`) but bootstrap's cargo runs on the beta toolchain thus we set `RUSTC_BOOTSTRAP=1` on the child process so it builds.
-> The generators call out to `rustfmt` to format their output so `rustfmt` needs to be on `PATH`. So added bootstrap's rustfmt  to `PATH` before each run. If rustfmt isn't available, the step fails early and tells the user to set `rustfmt = true` in `bootstrap.toml` .

r? @Kobzol
2026-10-08 00:15:32 +00:00
Folkert de Vries
96399615cf add core::arch::powerpc::ppcf128 2026-10-07 15:05:58 +02:00
Yilin Chen
75b0be8f54 remove redundant unsafe 2026-10-07 14:51:24 +08:00
Jakub Beránek
70670cff39 Run the generator from source root
To avoid picking up unrelated Cargo `config.toml` file.
2026-10-06 13:00:08 +02:00
Trevor Gross
e9b0eeb99d intrinsics: Rename abort to abort_immediate
The semantics of `intrinsics::abort()` are closer to what we have
unstably as `abort_immediate()` than to `process::abort()` or
`libc::abort()`. Rename it to make more clear that the intrinsic is more
of an intentional crash with platform-specific behavior than what
`libc::abort()` tries to be (i.e. raising `SIGABRT`).
2026-10-02 18:56:41 +00:00
Trevor Gross
475b967fed Rollup merge of #161015 - tgross35:stabilize-funnel-shifts, r=nia-e
Stabilize `funnel_shifts` (including `const`)

`funnel_shl` and `funnel_shr` have been around for close to a year, the unchecked versions for a number of months. These are reasonably small and uncontroversial, and it can be tricky to get similar performance with a fallback; stabilize them here.

Newly stable API:

```rust
impl {u8, u16, u32, u64, u128, usize} {
    pub const fn funnel_shl(self, right: Self, shift: u32) -> Self;
    pub const fn funnel_shr(self, right: Self, shift: u32) -> Self;

    pub const unsafe fn unchecked_funnel_shl(self, right: Self, shift: u32) -> Self;
    pub const unsafe fn unchecked_funnel_shr(self, right: Self, shift: u32) -> Self;
}
```

The tracking issue also mentions a `wrapping_` version but it has not been implemented.

Closes: https://github.com/rust-lang/rust/issues/145686 (tracking issue, wrapping versions will need a new issue)
2026-09-28 23:20:38 -05:00
Folkert de Vries
4282aee7a7 Merge pull request #2231 from Kobzol/sync
Pull from rust-lang/rust
2026-09-23 13:44:29 +00:00
David Wood
75dd3ee318 Merge pull request #2228 from folkertdev/better-simd-bitshift-tests
improve simd bitshift tests
2026-09-23 13:13:02 +00:00
Folkert de Vries
3ca6e6cf20 fix test_mm_srav_epi64 shift direction 2026-09-23 14:47:31 +02:00
Adam Gemmell
dabd0d2442 Merge pull request #2230 from folkertdev/s390x-llvm-fixmes
s390x: fix some fixmes
2026-09-21 10:26:16 +00:00
Jakub Beránek
20cdf9fd92 Merge ref '220b36c420c4' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Previous upstream ref: rust-lang/rust@32d94cc9be
New upstream ref: rust-lang/rust@220b36c420
Filtered ref: rust-lang/stdarch@a1fd5ae4f6
Upstream diff: 32d94cc9be...220b36c420

This merge was created using https://github.com/rust-lang/josh-sync.

# Conflicts:
#	rust-version
2026-09-21 11:09:07 +02:00
Jakub Beránek
fc49efd517 Prepare for merging from rust-lang/rust
This updates the rust-version file to 220b36c420.
2026-09-21 11:06:46 +02:00
Folkert de Vries
3da3866635 s390x: use u128 arithmetic 2026-09-20 15:09:09 +02:00
Folkert de Vries
fcddd10cfc s390x: use funnel shift 2026-09-20 15:03:16 +02:00
Folkert de Vries
7b339bc5a4 improve x86 simd bitshift tests 2026-09-17 21:37:18 +02:00
Folkert de Vries
a998f8ad99 improve simd bitshift tests 2026-09-17 21:36:51 +02:00
Adam Gemmell
43ba682938 Fix "unused dependency" 2026-09-17 21:30:00 +02:00
Adam Gemmell
f74d2edb0e Fix "package.homepage is redundant with package.repository" 2026-09-17 21:30:00 +02:00
Adam Gemmell
d37122ddd2 Fix "explicit package.readme can be inferred" 2026-09-17 21:30:00 +02:00
Adam Gemmell
599c44ecb1 Run cargo fmt on JOSH syncs 2026-09-17 21:30:00 +02:00
Ralf Jung
beac67dfff fmt 2026-09-17 21:30:00 +02:00
Ralf Jung
20a1f5228e de-constify methods that depended on the vector shift ones 2026-09-17 21:30:00 +02:00
Ralf Jung
91a8a01cca Revert "Use SIMD intrinsics for vector shifts"
This reverts commit 102f03d2c410660a45d0231fdafdd347e0d4e77f.
2026-09-17 21:29:59 +02:00
Adam Gemmell
5761e972f3 Update vzipq arm instruction assertions 2026-09-17 21:29:59 +02:00
Adam Gemmell
20e2422b45 Run rustfmt 2026-09-17 21:29:59 +02:00
The rustc-josh-sync Cronjob Bot
d580d01200 Prepare for merging from rust-lang/rust
This updates the rust-version file to 32d94cc9be.
2026-09-17 21:29:59 +02:00
tangaac
964fc0abe8 loongarch: Add portable intrinsics::simd implementations for VAVG/VAVGR intrinsics 2026-09-17 21:29:59 +02:00
The rustc-josh-sync Cronjob Bot
2ccfcf8131 Prepare for merging from rust-lang/rust
This updates the rust-version file to da5114692c.
2026-09-17 21:29:59 +02:00
Sergey "Shnatsel" Davidoff
5cf706f95f cargo fmt 2026-09-17 21:29:59 +02:00
Sergey "Shnatsel" Davidoff
f3f6cfd780 Use the proper tracking issue 2026-09-17 21:29:58 +02:00
Sergey "Shnatsel" Davidoff
1828711cd2 Add manual exception for the intrinsics forgotten in the intel intrinsics guide xml 2026-09-17 21:29:58 +02:00
Sergey "Shnatsel" Davidoff
7acb332c3f Add missing avx512vl intrinsics for f32->u32 conversions 2026-09-17 21:29:58 +02:00
Folkert de Vries
41bc79c38e Merge pull request #2226 from heiher/loong64-intrinsic-test
intrinsic-test: Support testing LoongArch64 SIMD intrinsics
2026-09-17 14:58:36 +00:00
WANG Rui
bb2b679c54 intrinsic-test: Support testing LoongArch64 SIMD intrinsics 2026-09-17 20:05:55 +08:00
WANG Rui
5a01034212 intrinsic-test: Add C intrinsic name prefix support
Add a per-architecture C intrinsic name prefix to support architectures
whose C intrinsic names differ from their Rust intrinsic names.
2026-09-17 20:05:54 +08:00
WANG Rui
4ff0ef647a intrinsic-test: Fix intrinsic test names for negative immediate values 2026-09-15 00:08:33 +08:00
Jakub Beránek
1d6ecb3d7e Install rustfmt on CI 2026-09-14 13:45:18 +02:00
Jakub Beránek
1bda26edef Fix tests 2026-09-14 13:22:42 +02:00
Jakub Beránek
988cc4b43b Bless arm output 2026-09-14 13:22:42 +02:00
xonx
34bda05490 Show diff when generated files do not match expectations 2026-09-14 13:22:42 +02:00
Jakub Beránek
2b0ee0b195 Use unified rustfmt formatting in stdarch-gen-arm 2026-09-14 13:22:42 +02:00
Jakub Beránek
d0f689751b Use rustfmt formatting in stdarch-gen-loongarch 2026-09-14 13:22:42 +02:00
Jakub Beránek
d4056727a0 Automatically reformat all generated files with a unified rustfmt config 2026-09-14 13:22:42 +02:00
Jakub Beránek
8b691497dd Use clap to parse arguments in stdarch-gen-hexagon 2026-09-14 13:22:42 +02:00
Folkert de Vries
c18068c29a Merge pull request #2223 from clarfonthey/triagebot
Enable triagebot relabelling
2026-09-14 10:43:48 +00:00
Adam Gemmell
6c68a595e9 Merge pull request #2224 from folkertdev/win-gnu-no-f16
only run `f16` tests when `target_has_reliable_f16`
2026-09-14 10:28:35 +00:00
Amanieu d'Antras
dbac732cc1 Merge pull request #2214 from valentynkit/vld1-lane-unaligned
neon: drop the align requirement on vld1/vst1/vld1 lane loads and stores, dup loads
2026-09-14 09:06:31 +00:00
ltdk
5bf69a211c Enable triagebot relabelling 2026-09-13 20:16:32 -04:00
Folkert de Vries
655ec5ad3a Merge pull request #2222 from adamgemmell/dev/adagem01/cargo-lints
Fix new Cargo lints
2026-09-13 23:23:33 +00:00