[−][src]Function safe_arch::sign_apply_i16_m128i
#[must_use]pub fn sign_apply_i16_m128i(a: m128i, b: m128i) -> m128i
This is supported with target feature
ssse3
only.Applies the sign of i16
values in b
to the values in a
.
- If
b
is negative: thea
value is negated. - Else If
b
is 0: thea
value becomes 0. - Else the
a
value is unchanged.
let a = m128i::from([1_i16, 2, -3, 4, 5, 6, 7, 8]); let b = m128i::from([5_i16, -6, 7, 0, 1, 1, 0, 1]); let c: [i16; 8] = sign_apply_i16_m128i(a, b).into(); assert_eq!(c, [1_i16, -2, -3, 0, 5, 6, 0, 8]);