Skip to content

Commit f255136

Browse files
jieyouxugitbot
authored and
gitbot
committed
Rollup merge of rust-lang#137551 - folkertdev:import-simd-intrinsics, r=RalfJung
import `simd_` intrinsics In most cases, we can import the simd intrinsics rather than redeclare them. Apparently, most of these tests were written before `std::intrinsics::simd` existed. There are a couple of exceptions where we can't yet import: - the intrinsics are not declared as `const fn` in the standard library, causing issues in the `const-eval` tests - the `simd_shuffle_generic` function is not exposed from `std::intrinsics` - the `simd_fpow` and `simd_fpowi` functions are not exposed from `std::intrinsics` (removed in rust-lang#137595) - some tests use `no_core`, and therefore cannot use `std::intrinsics` r? ```@RalfJung``` cc ```@workingjubilee``` do you have context on why some intrinsics are not exposed?
2 parents 9692231 + 5479b2a commit f255136

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/intrinsics/simd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// `idx` must be in-bounds of the vector.
1212
#[rustc_intrinsic]
1313
#[rustc_nounwind]
14-
pub unsafe fn simd_insert<T, U>(_x: T, _idx: u32, _val: U) -> T;
14+
pub const unsafe fn simd_insert<T, U>(_x: T, _idx: u32, _val: U) -> T;
1515

1616
/// Extracts an element from a vector.
1717
///
@@ -22,7 +22,7 @@ pub unsafe fn simd_insert<T, U>(_x: T, _idx: u32, _val: U) -> T;
2222
/// `idx` must be in-bounds of the vector.
2323
#[rustc_intrinsic]
2424
#[rustc_nounwind]
25-
pub unsafe fn simd_extract<T, U>(_x: T, _idx: u32) -> U;
25+
pub const unsafe fn simd_extract<T, U>(_x: T, _idx: u32) -> U;
2626

2727
/// Adds two simd vectors elementwise.
2828
///

0 commit comments

Comments
 (0)