Function safe_arch::pack_i32_to_u16_m256i
source ยท pub fn pack_i32_to_u16_m256i(a: m256i, b: m256i) -> m256i
Available with target feature
avx2
only.Expand description
Saturating convert i32
to u16
, 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: [u16; 16] = pack_i32_to_u16_m256i(a, b).into();
assert_eq!(c, [1_u16, 2, 3, 4, 9, 10, 11, 12, 5, 6, 7, 8, 13, 14, 15, 16]);
- Intrinsic:
_mm256_packus_epi32
- Assembly:
vpackusdw ymm, ymm, ymm