[][src]Function safe_arch::pack_i32_to_i16_m256i

#[must_use]pub fn pack_i32_to_i16_m256i(a: m256i, b: m256i) -> m256i
This is supported with target feature avx2 only.

Saturating convert i32 to i16, and pack the values.

  • The values are packed 128 bits at a time: a_low, b_low, a_high, b_high
let a = m256i::from([1_i32, 2, 3, 4, 5, 6, 7, 8]);
let b = m256i::from([9_i32, 10, 11, 12, 13, 14, 15, 16]);
let c: [i16; 16] = pack_i32_to_i16_m256i(a, b).into();
assert_eq!(c, [1_i16, 2, 3, 4, 9, 10, 11, 12, 5, 6, 7, 8, 13, 14, 15, 16]);