Function safe_arch::fused_mul_subadd_m256
source ยท pub fn fused_mul_subadd_m256(a: m256, b: m256, c: m256) -> m256
Available with target feature
fma
only.Expand description
Lanewise fused (a * b) subadd c
(subtracts odd lanes and adds even lanes)
let a = m256::from_array([1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0]);
let b = m256::from_array([5.0, 6.0, 7.0, 8.0, 5.0, 6.0, 7.0, 8.0]);
let c = m256::from_array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]);
let d = fused_mul_subadd_m256(a, b, c).to_array();
assert_eq!(d, [6.0, 11.0, 22.0, 31.0, 6.0, 11.0, 22.0, 31.0]);
- Intrinsic:
_mm256_fmsubadd_ps
- Assembly: one of
vfmsubadd132ps ymm, ymm, ymm
vfmsubadd213ps ymm, ymm, ymm
vfmsubadd231ps ymm, ymm, ymm