[−][src]Function safe_arch::add_horizontal_i16_m256i
#[must_use]pub fn add_horizontal_i16_m256i(a: m256i, b: m256i) -> m256i
This is supported with target feature
avx2
only.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; 16]); let b = m256i::from([6_i16; 16]); let c: [i16; 16] = add_horizontal_i16_m256i(a, b).into(); assert_eq!( c, [10_i16, 10, 10, 10, 12, 12, 12, 12, 10, 10, 10, 10, 12, 12, 12, 12] );
- Intrinsic:
_mm256_hadd_epi16
- Assembly:
vphaddw ymm, ymm, ymm