Function safe_arch::sub_saturating_u8_m256i
source ยท pub fn sub_saturating_u8_m256i(a: m256i, b: m256i) -> m256i
Available with target feature
avx2
only.Expand description
Lanewise saturating a - b
with lanes as u8
.
let a = m256i::from([126_u8; 32]);
let b = m256i::from([125_u8; 32]);
let c: [u8; 32] = sub_saturating_u8_m256i(a, b).into();
assert_eq!(c, [1_u8; 32]);
- Intrinsic:
_mm256_subs_epu8
- Assembly:
vpsubusb ymm, ymm, ymm