Function safe_arch::mul_u16_keep_high_m256i
source · pub fn mul_u16_keep_high_m256i(a: m256i, b: m256i) -> m256iExpand description
Multiply the u16 lanes and keep the high half of each 32-bit output.
let a =
m256i::from([5_u16, 6, 2, 5, 4, 3, 1, 0, 12000, 13, 56, 21, 8, 7, 6, 5]);
let b = m256i::from([
12000_u16, 13000, 2000, 800, 0, 1, 2, 3, 8, 7, 6, 5, 234, 654, 123, 978,
]);
let c: [u16; 16] = mul_u16_keep_high_m256i(a, b).into();
assert_eq!(c, [0_u16, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]);- Intrinsic:
_mm256_mulhi_epu16 - Assembly:
vpmulhuw ymm, ymm, ymm