Function safe_arch::shr_each_i32_m128i
source ยท pub fn shr_each_i32_m128i(a: m128i, count: m128i) -> m128i
Available with target feature
avx2
only.Expand description
Shift i32
values to the right by count
bits.
- Each
i32
lane ina
is shifted by the same indexedu32
lane incount
.
let a = m128i::from([100, 110, 120, -130]);
let count = m128i::from([1, 2, 3, 4]);
let out: [i32; 4] = shr_each_i32_m128i(a, count).into();
assert_eq!(out, [100 >> 1, 110 >> 2, 120 >> 3, (-130) >> 4]);
- Intrinsic:
_mm_srav_epi32
- Assembly:
vpsravd xmm, xmm, xmm