[][src]Function safe_arch::mul_i16_scale_round_m128i

#[must_use]pub fn mul_i16_scale_round_m128i(a: m128i, b: m128i) -> m128i
This is supported with target feature ssse3 only.

Multiply i16 lanes into i32 intermediates, keep the high 18 bits, round by adding 1, right shift by 1.

This is _mm_mulhrs_epi16, which I can only assume is named for something like "high bits rounded and scaled".

let a = m128i::from([0_i16, 100, 200, 300, 400, 500, 600, 700]);
let b = m128i::from([800_i16, 900, 1000, 1100, 1200, 1300, 1400, 1500]);
let c: [i16; 8] = mul_i16_scale_round_m128i(a, b).into();
assert_eq!(c, [0, 3, 6, 10, 15, 20, 26, 32]);