[−][src]Function safe_arch::sign_apply_i32_m256i
#[must_use]pub fn sign_apply_i32_m256i(a: m256i, b: m256i) -> m256i
This is supported with target feature
avx2
only.Lanewise a * signum(b)
with lanes as i32
- If
b
is positive, the output isa
. - If
b
is zero, the output is 0. - If
b
is negative, the output is-a
.
let a = m256i::from([0_i32, 1, 2, 3, 4, 5, 6, 7]); let b = m256i::from([0_i32, 0, -2, -13, 4, 15, 6, -17]); let c: [i32; 8] = sign_apply_i32_m256i(a, b).into(); assert_eq!(c, [0_i32, 0, -2, -3, 4, 5, 6, -7]);
- Intrinsic:
_mm256_sign_epi32
- Assembly:
vpsignd ymm, ymm, ymm