Function safe_arch::sub_horizontal_i16_m256i
source ยท pub fn sub_horizontal_i16_m256i(a: m256i, b: m256i) -> m256i
Available with target feature
avx2
only.Expand description
Horizontal a - b
with lanes as i16
.
- The results are interleaved 128-bits at a time: a.low, b.low, a.high, b.high
let a = m256i::from([5_i16, 6, 2, 5, 4, 3, 1, 0, -12, 13, 56, 21, 8, 7, 6, 5]);
let b = m256i::from([12000_i16, 13000, -2, -8, 0, 1, 2, 3, 8, 7, 6, 5, 234, 654, 123, 978]);
let c: [i16; 16] = add_horizontal_i16_m256i(a, b).into();
assert_eq!(c, [11_i16, 7, 7, 1, 25000, -10, 1, 5, 1, 77, 15, 11, 15, 11, 888, 1101]);
- Intrinsic:
_mm256_hsub_epi16
- Assembly:
vphsubw ymm, ymm, ymm