[][src]Function safe_arch::sign_apply_i32_m128i

#[must_use]pub fn sign_apply_i32_m128i(a: m128i, b: m128i) -> m128i
This is supported with target feature ssse3 only.

Applies the sign of i32 values in b to the values in a.

  • If b is negative: the a value is negated.
  • Else If b is 0: the a value becomes 0.
  • Else the a value is unchanged.
let a = m128i::from([1, 2, -3, 4]);
let b = m128i::from([5, -6, 7, 0]);
let c: [i32; 4] = sign_apply_i32_m128i(a, b).into();
assert_eq!(c, [1, -2, -3, 0]);