Skip to content

Commit 12e8ab4

Browse files
committed
[breaking change]: mask argument type of _mm_shuffle_ps
1 parent 0309be1 commit 12e8ab4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

coresimd/x86/sse.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -981,8 +981,8 @@ pub unsafe fn _mm_setzero_ps() -> __m128 {
981981
#[inline]
982982
#[allow(non_snake_case)]
983983
#[unstable(feature = "stdsimd", issue = "27731")]
984-
pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> u32 {
985-
(z << 6) | (y << 4) | (x << 2) | w
984+
pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> i32 {
985+
((z << 6) | (y << 4) | (x << 2) | w) as i32
986986
}
987987

988988
/// Shuffle packed single-precision (32-bit) floating-point elements in `a` and
@@ -997,7 +997,7 @@ pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> u32 {
997997
#[cfg_attr(test, assert_instr(shufps, mask = 3))]
998998
#[rustc_args_required_const(2)]
999999
#[stable(feature = "simd_x86", since = "1.27.0")]
1000-
pub unsafe fn _mm_shuffle_ps(a: __m128, b: __m128, mask: u32) -> __m128 {
1000+
pub unsafe fn _mm_shuffle_ps(a: __m128, b: __m128, mask: i32) -> __m128 {
10011001
let mask = (mask & 0xFF) as u8;
10021002

10031003
macro_rules! shuffle_done {

crates/stdsimd-verify/tests/x86-intel.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ fn verify_all_signatures() {
142142
// verified.
143143
"__readeflags" | "__writeeflags" | "__cpuid_count" | "__cpuid"
144144
| "__get_cpuid_max" => continue,
145-
145+
// Intel requires the mask argument for _mm_shuffle_ps to be an
146+
// unsigned integer, but all other _mm_shuffle_.. intrinsics
147+
// take a signed-integer. This breaks `_MM_SHUFFLE` for
148+
// `_mm_shuffle_ps`:
149+
"_mm_shuffle_ps" => continue,
146150
_ => {}
147151
}
148152

0 commit comments

Comments
 (0)