about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/stdarch/coresimd/x86/sse.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/library/stdarch/coresimd/x86/sse.rs b/library/stdarch/coresimd/x86/sse.rs
index a51f3f14233..5fa3ed0c57d 100644
--- a/library/stdarch/coresimd/x86/sse.rs
+++ b/library/stdarch/coresimd/x86/sse.rs
@@ -2040,6 +2040,8 @@ extern "C" {
     fn pminub(a: __m64, b: __m64) -> __m64;
     #[link_name = "llvm.x86.mmx.pmulhu.w"]
     fn pmulhuw(a: __m64, b: __m64) -> __m64;
+    #[link_name = "llvm.x86.mmx.pmull.w"]
+    fn pmullw(a: __m64, b: __m64) -> __m64;
     #[link_name = "llvm.x86.mmx.pavg.b"]
     fn pavgb(a: __m64, b: __m64) -> __m64;
     #[link_name = "llvm.x86.mmx.pavg.w"]
@@ -2157,6 +2159,16 @@ pub unsafe fn _mm_mulhi_pu16(a: __m64, b: __m64) -> __m64 {
     pmulhuw(a, b)
 }
 
+/// Multiplies packed 16-bit integer values and writes the
+/// low-order 16 bits of each 32-bit product to the corresponding bits in
+/// the destination.
+#[inline]
+#[target_feature(enable = "sse,mmx")]
+#[cfg_attr(test, assert_instr(pmullw))]
+pub unsafe fn _mm_mullo_pi16(a: __m64, b: __m64) -> __m64 {
+    pmullw(a, b)
+}
+
 /// Multiplies packed 16-bit unsigned integer values and writes the
 /// high-order 16 bits of each 32-bit product to the corresponding bits in
 /// the destination.
@@ -4002,6 +4014,13 @@ mod tests {
     }
 
     #[simd_test(enable = "sse,mmx")]
+    unsafe fn test_mm_mullo_pi16() {
+        let (a, b) = (_mm_set1_pi16(1000), _mm_set1_pi16(1001));
+        let r = _mm_mullo_pi16(a, b);
+        assert_eq_m64(r, _mm_set1_pi16(17960));
+    }
+
+    #[simd_test(enable = "sse,mmx")]
     unsafe fn test_m_pmulhuw() {
         let (a, b) = (_mm_set1_pi16(1000), _mm_set1_pi16(1001));
         let r = _m_pmulhuw(a, b);