Skip to content

Commit 78891cd

Browse files
authored
Explain the discrepancy in the mask type for _mm_shuffle_ps (#879)
1 parent 311d56c commit 78891cd

File tree

1 file changed

+6
-0
lines changed
  • crates/core_arch/src/x86

1 file changed

+6
-0
lines changed

crates/core_arch/src/x86/sse.rs

+6
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,12 @@ pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> i32 {
992992
/// `b`. Mask is split to 2 control bits each to index the element from inputs.
993993
///
994994
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shuffle_ps)
995+
///
996+
/// Note that there appears to be a mistake within Intel's Intrinsics Guide.
997+
/// `_mm_shuffle_ps` is supposed to take an `i32` instead of an `u32`
998+
/// as is the case for [other shuffle intrinsics](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shuffle_).
999+
/// Performing an implicit type conversion between an unsigned integer and a signed integer
1000+
/// does not cause a problem in C, however Rust's commitment to strong typing does not allow this.
9951001
#[inline]
9961002
#[target_feature(enable = "sse")]
9971003
#[cfg_attr(test, assert_instr(shufps, mask = 3))]

0 commit comments

Comments
 (0)