Skip to content

stdarch subtree update #143642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jul 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e101e38
std_detect: Tidying of slice length
a4lg Jun 29, 2025
bb2d169
use `is_multiple_of` to check if an addr is aligned
folkertdev Jul 5, 2025
e8d9e80
Add empty rust-version file
Kobzol Jun 26, 2025
f697f81
Add josh synchronization scripts
Kobzol Jun 26, 2025
8ae4e6a
Update stabilization version of certain x86 intrinsics to 1.89
Amanieu Jun 30, 2025
e46d220
Use simd_extract! macro instead of calling simd_extract directly
clarfonthey Jun 30, 2025
600497f
Mark `avx` broadcast intrinsics as safe
okaneco Jun 23, 2025
b535003
Remove std-detect dev dependency in core_arch
Kobzol Jul 4, 2025
816f029
Update README.md
kilavvy Jun 29, 2025
8600192
Add config files for `rustc-josh-sync`
Kobzol Jul 4, 2025
ce73251
Prepare for merging from rust-lang/rust
Kobzol Jul 4, 2025
1bc289d
std_detect: RISC-V Linux: Ergonomic querying with `riscv_hwprobe`
a4lg Jun 29, 2025
fddd05b
some clippy fixes
hkBst Jul 6, 2025
658b5c8
Use `simd_funnel_sh{l,r}` and `simd_round_ties_even` to remove uses o…
sayantn Jul 7, 2025
a95bd00
Remove custom josh-sync scripts
Kobzol Jul 8, 2025
07d5fbb
Update README with link to `josh-sync`
Kobzol Jul 8, 2025
82126a6
fix whitespace in `aarch64.spec.yml`
folkertdev Jul 8, 2025
323c646
remote intermediate assignment
folkertdev Jul 8, 2025
92701fe
shorten array literals
folkertdev Jul 8, 2025
061a941
remove unneeded cast
folkertdev Jul 8, 2025
701d222
Reset rust-version
Kobzol Jul 8, 2025
3c9297c
Prepare for merging from rust-lang/rust
Kobzol Jul 8, 2025
bdead41
Merge ref '040e2f8b9ff2' from rust-lang/rust
Kobzol Jul 8, 2025
a310bdd
Merge pull request #1853 from Kobzol/pull-fixed
Amanieu Jul 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion library/stdarch/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
name = "core_arch"
version = "0.1.5"
dependencies = [
"std_detect",
"stdarch-test",
"syscalls",
]
Expand Down
6 changes: 6 additions & 0 deletions library/stdarch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ This repository contains two main crates:

The `std::simd` component now lives in the
[`packed_simd_2`](https://github.com/rust-lang/packed_simd) crate.

## Synchronizing josh subtree with rustc

This repository is linked to `rust-lang/rust` as a [josh](https://josh-project.github.io/josh/intro.html) subtree. You can use the [rustc-josh-sync](https://github.com/rust-lang/josh-sync) tool to perform synchronization.

You can find a guide on how to perform the synchronization [here](https://rustc-dev-guide.rust-lang.org/external-repos.html#synchronizing-a-josh-subtree).
1 change: 0 additions & 1 deletion library/stdarch/crates/core_arch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ maintenance = { status = "experimental" }

[dev-dependencies]
stdarch-test = { version = "0.*", path = "../stdarch-test" }
std_detect = { version = "0.*", path = "../std_detect" }

[target.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.dev-dependencies]
syscalls = { version = "0.6.18", default-features = false }
Expand Down
103 changes: 18 additions & 85 deletions library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7925,7 +7925,7 @@ pub fn vcvth_f16_u64(a: u64) -> f16 {
#[unstable(feature = "stdarch_neon_f16", issue = "136306")]
pub fn vcvth_n_f16_s16<const N: i32>(a: i16) -> f16 {
static_assert!(N >= 1 && N <= 16);
vcvth_n_f16_s32::<N>(a as i32) as f16
vcvth_n_f16_s32::<N>(a as i32)
}
#[doc = "Fixed-point convert to floating-point"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvth_n_f16_s32)"]
Expand Down Expand Up @@ -7972,7 +7972,7 @@ pub fn vcvth_n_f16_s64<const N: i32>(a: i64) -> f16 {
#[unstable(feature = "stdarch_neon_f16", issue = "136306")]
pub fn vcvth_n_f16_u16<const N: i32>(a: u16) -> f16 {
static_assert!(N >= 1 && N <= 16);
vcvth_n_f16_u32::<N>(a as u32) as f16
vcvth_n_f16_u32::<N>(a as u32)
}
#[doc = "Fixed-point convert to floating-point"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vcvth_n_f16_u32)"]
Expand Down Expand Up @@ -17158,7 +17158,7 @@ pub fn vqdmlalh_s16(a: i32, b: i16, c: i16) -> i32 {
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqdmlals_s32(a: i64, b: i32, c: i32) -> i64 {
let x: i64 = vqaddd_s64(a, vqdmulls_s32(b, c));
x as i64
x
}
#[doc = "Signed saturating doubling multiply-subtract long"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqdmlsl_high_lane_s16)"]
Expand Down Expand Up @@ -17324,7 +17324,7 @@ pub fn vqdmlslh_s16(a: i32, b: i16, c: i16) -> i32 {
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqdmlsls_s32(a: i64, b: i32, c: i32) -> i64 {
let x: i64 = vqsubd_s64(a, vqdmulls_s32(b, c));
x as i64
x
}
#[doc = "Vector saturating doubling multiply high by scalar"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqdmulh_lane_s16)"]
Expand Down Expand Up @@ -19495,10 +19495,7 @@ pub fn vqtbl1q_s8(a: int8x16_t, b: uint8x16_t) -> int8x16_t {
#[cfg_attr(test, assert_instr(tbl))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqtbl1_u8(a: uint8x16_t, b: uint8x8_t) -> uint8x8_t {
unsafe {
let x = transmute(vqtbl1(transmute(a), b));
x
}
unsafe { transmute(vqtbl1(transmute(a), b)) }
}
#[doc = "Table look-up"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbl1q_u8)"]
Expand All @@ -19507,10 +19504,7 @@ pub fn vqtbl1_u8(a: uint8x16_t, b: uint8x8_t) -> uint8x8_t {
#[cfg_attr(test, assert_instr(tbl))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqtbl1q_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
unsafe {
let x = transmute(vqtbl1q(transmute(a), b));
x
}
unsafe { transmute(vqtbl1q(transmute(a), b)) }
}
#[doc = "Table look-up"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbl1_p8)"]
Expand All @@ -19519,10 +19513,7 @@ pub fn vqtbl1q_u8(a: uint8x16_t, b: uint8x16_t) -> uint8x16_t {
#[cfg_attr(test, assert_instr(tbl))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqtbl1_p8(a: poly8x16_t, b: uint8x8_t) -> poly8x8_t {
unsafe {
let x = transmute(vqtbl1(transmute(a), b));
x
}
unsafe { transmute(vqtbl1(transmute(a), b)) }
}
#[doc = "Table look-up"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbl1q_p8)"]
Expand All @@ -19531,10 +19522,7 @@ pub fn vqtbl1_p8(a: poly8x16_t, b: uint8x8_t) -> poly8x8_t {
#[cfg_attr(test, assert_instr(tbl))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqtbl1q_p8(a: poly8x16_t, b: uint8x16_t) -> poly8x16_t {
unsafe {
let x = transmute(vqtbl1q(transmute(a), b));
x
}
unsafe { transmute(vqtbl1q(transmute(a), b)) }
}
#[doc = "Table look-up"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbl2)"]
Expand Down Expand Up @@ -20397,10 +20385,7 @@ pub fn vqtbx1q_s8(a: int8x16_t, b: int8x16_t, c: uint8x16_t) -> int8x16_t {
#[cfg_attr(test, assert_instr(tbx))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqtbx1_u8(a: uint8x8_t, b: uint8x16_t, c: uint8x8_t) -> uint8x8_t {
unsafe {
let x = transmute(vqtbx1(transmute(a), transmute(b), c));
x
}
unsafe { transmute(vqtbx1(transmute(a), transmute(b), c)) }
}
#[doc = "Extended table look-up"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbx1q_u8)"]
Expand All @@ -20409,10 +20394,7 @@ pub fn vqtbx1_u8(a: uint8x8_t, b: uint8x16_t, c: uint8x8_t) -> uint8x8_t {
#[cfg_attr(test, assert_instr(tbx))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqtbx1q_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t {
unsafe {
let x = transmute(vqtbx1q(transmute(a), transmute(b), c));
x
}
unsafe { transmute(vqtbx1q(transmute(a), transmute(b), c)) }
}
#[doc = "Extended table look-up"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbx1_p8)"]
Expand All @@ -20421,10 +20403,7 @@ pub fn vqtbx1q_u8(a: uint8x16_t, b: uint8x16_t, c: uint8x16_t) -> uint8x16_t {
#[cfg_attr(test, assert_instr(tbx))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqtbx1_p8(a: poly8x8_t, b: poly8x16_t, c: uint8x8_t) -> poly8x8_t {
unsafe {
let x = transmute(vqtbx1(transmute(a), transmute(b), c));
x
}
unsafe { transmute(vqtbx1(transmute(a), transmute(b), c)) }
}
#[doc = "Extended table look-up"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbx1q_p8)"]
Expand All @@ -20433,10 +20412,7 @@ pub fn vqtbx1_p8(a: poly8x8_t, b: poly8x16_t, c: uint8x8_t) -> poly8x8_t {
#[cfg_attr(test, assert_instr(tbx))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub fn vqtbx1q_p8(a: poly8x16_t, b: poly8x16_t, c: uint8x16_t) -> poly8x16_t {
unsafe {
let x = transmute(vqtbx1q(transmute(a), transmute(b), c));
x
}
unsafe { transmute(vqtbx1q(transmute(a), transmute(b), c)) }
}
#[doc = "Extended table look-up"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbx2)"]
Expand Down Expand Up @@ -23785,14 +23761,7 @@ pub fn vrndph_f16(a: f16) -> f16 {
#[unstable(feature = "stdarch_neon_f16", issue = "136306")]
#[cfg_attr(test, assert_instr(frintx))]
pub fn vrndx_f16(a: float16x4_t) -> float16x4_t {
unsafe extern "unadjusted" {
#[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"),
link_name = "llvm.rint.v4f16"
)]
fn _vrndx_f16(a: float16x4_t) -> float16x4_t;
}
unsafe { _vrndx_f16(a) }
unsafe { simd_round_ties_even(a) }
}
#[doc = "Floating-point round to integral exact, using current rounding mode"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndxq_f16)"]
Expand All @@ -23801,14 +23770,7 @@ pub fn vrndx_f16(a: float16x4_t) -> float16x4_t {
#[unstable(feature = "stdarch_neon_f16", issue = "136306")]
#[cfg_attr(test, assert_instr(frintx))]
pub fn vrndxq_f16(a: float16x8_t) -> float16x8_t {
unsafe extern "unadjusted" {
#[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"),
link_name = "llvm.rint.v8f16"
)]
fn _vrndxq_f16(a: float16x8_t) -> float16x8_t;
}
unsafe { _vrndxq_f16(a) }
unsafe { simd_round_ties_even(a) }
}
#[doc = "Floating-point round to integral exact, using current rounding mode"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndx_f32)"]
Expand All @@ -23817,14 +23779,7 @@ pub fn vrndxq_f16(a: float16x8_t) -> float16x8_t {
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
#[cfg_attr(test, assert_instr(frintx))]
pub fn vrndx_f32(a: float32x2_t) -> float32x2_t {
unsafe extern "unadjusted" {
#[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"),
link_name = "llvm.rint.v2f32"
)]
fn _vrndx_f32(a: float32x2_t) -> float32x2_t;
}
unsafe { _vrndx_f32(a) }
unsafe { simd_round_ties_even(a) }
}
#[doc = "Floating-point round to integral exact, using current rounding mode"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndxq_f32)"]
Expand All @@ -23833,14 +23788,7 @@ pub fn vrndx_f32(a: float32x2_t) -> float32x2_t {
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
#[cfg_attr(test, assert_instr(frintx))]
pub fn vrndxq_f32(a: float32x4_t) -> float32x4_t {
unsafe extern "unadjusted" {
#[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"),
link_name = "llvm.rint.v4f32"
)]
fn _vrndxq_f32(a: float32x4_t) -> float32x4_t;
}
unsafe { _vrndxq_f32(a) }
unsafe { simd_round_ties_even(a) }
}
#[doc = "Floating-point round to integral exact, using current rounding mode"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndx_f64)"]
Expand All @@ -23849,14 +23797,7 @@ pub fn vrndxq_f32(a: float32x4_t) -> float32x4_t {
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
#[cfg_attr(test, assert_instr(frintx))]
pub fn vrndx_f64(a: float64x1_t) -> float64x1_t {
unsafe extern "unadjusted" {
#[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"),
link_name = "llvm.rint.v1f64"
)]
fn _vrndx_f64(a: float64x1_t) -> float64x1_t;
}
unsafe { _vrndx_f64(a) }
unsafe { simd_round_ties_even(a) }
}
#[doc = "Floating-point round to integral exact, using current rounding mode"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndxq_f64)"]
Expand All @@ -23865,14 +23806,7 @@ pub fn vrndx_f64(a: float64x1_t) -> float64x1_t {
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
#[cfg_attr(test, assert_instr(frintx))]
pub fn vrndxq_f64(a: float64x2_t) -> float64x2_t {
unsafe extern "unadjusted" {
#[cfg_attr(
any(target_arch = "aarch64", target_arch = "arm64ec"),
link_name = "llvm.rint.v2f64"
)]
fn _vrndxq_f64(a: float64x2_t) -> float64x2_t;
}
unsafe { _vrndxq_f64(a) }
unsafe { simd_round_ties_even(a) }
}
#[doc = "Floating-point round to integral, using current rounding mode"]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndxh_f16)"]
Expand Down Expand Up @@ -24082,7 +24016,6 @@ pub fn vrsqrtes_f32(a: f32) -> f32 {
#[doc = "Reciprocal square-root estimate."]
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrsqrteh_f16)"]
#[inline]
#[target_feature(enable = "neon,fp16")]
#[cfg_attr(test, assert_instr(frsqrte))]
#[target_feature(enable = "neon,fp16")]
#[unstable(feature = "stdarch_neon_f16", issue = "136306")]
Expand Down
6 changes: 3 additions & 3 deletions library/stdarch/crates/core_arch/src/arm_shared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
//! Section 10.1 of ACLE says:
//!
//! - "In the sequence of Arm architectures { v5, v5TE, v6, v6T2, v7 } each architecture includes
//! its predecessor instruction set."
//! its predecessor's instruction set."
//!
//! - "In the sequence of Thumb-only architectures { v6-M, v7-M, v7E-M } each architecture includes
//! its predecessor instruction set."
//! its predecessor's instruction set."
//!
//! From that info and from looking at how LLVM features work (using custom targets) we can identify
//! features that are subsets of others:
Expand All @@ -38,7 +38,7 @@
//! *NOTE*: Section 5.4.7 of ACLE says:
//!
//! - "__ARM_FEATURE_DSP is defined to 1 if the DSP (v5E) instructions are supported and the
//! intrinsics defined in Saturating intrinsics are available."
//! intrinsics defined in Saturating intrinsics are available."
//!
//! This does *not* match how LLVM uses the '+dsp' feature; this feature is not set for v5te
//! targets so we have to work around this difference.
Expand Down
Loading
Loading