Skip to content

Commit 2777950

Browse files
TheIronBorngnzlbg
authored andcommitted
add _mm_mullo_pi16 intrinsic
1 parent dda4072 commit 2777950

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

coresimd/x86/sse.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,6 +2040,8 @@ extern "C" {
20402040
fn pminub(a: __m64, b: __m64) -> __m64;
20412041
#[link_name = "llvm.x86.mmx.pmulhu.w"]
20422042
fn pmulhuw(a: __m64, b: __m64) -> __m64;
2043+
#[link_name = "llvm.x86.mmx.pmull.w"]
2044+
fn pmullw(a: __m64, b: __m64) -> __m64;
20432045
#[link_name = "llvm.x86.mmx.pavg.b"]
20442046
fn pavgb(a: __m64, b: __m64) -> __m64;
20452047
#[link_name = "llvm.x86.mmx.pavg.w"]
@@ -2157,6 +2159,16 @@ pub unsafe fn _mm_mulhi_pu16(a: __m64, b: __m64) -> __m64 {
21572159
pmulhuw(a, b)
21582160
}
21592161

2162+
/// Multiplies packed 16-bit integer values and writes the
2163+
/// low-order 16 bits of each 32-bit product to the corresponding bits in
2164+
/// the destination.
2165+
#[inline]
2166+
#[target_feature(enable = "sse,mmx")]
2167+
#[cfg_attr(test, assert_instr(pmullw))]
2168+
pub unsafe fn _mm_mullo_pi16(a: __m64, b: __m64) -> __m64 {
2169+
pmullw(a, b)
2170+
}
2171+
21602172
/// Multiplies packed 16-bit unsigned integer values and writes the
21612173
/// high-order 16 bits of each 32-bit product to the corresponding bits in
21622174
/// the destination.
@@ -4001,6 +4013,13 @@ mod tests {
40014013
assert_eq_m64(r, _mm_set1_pi16(15));
40024014
}
40034015

4016+
#[simd_test(enable = "sse,mmx")]
4017+
unsafe fn test_mm_mullo_pi16() {
4018+
let (a, b) = (_mm_set1_pi16(1000), _mm_set1_pi16(1001));
4019+
let r = _mm_mullo_pi16(a, b);
4020+
assert_eq_m64(r, _mm_set1_pi16(17960));
4021+
}
4022+
40044023
#[simd_test(enable = "sse,mmx")]
40054024
unsafe fn test_m_pmulhuw() {
40064025
let (a, b) = (_mm_set1_pi16(1000), _mm_set1_pi16(1001));

0 commit comments

Comments
 (0)