[][src]Function safe_arch::fused_mul_neg_add_m128

#[must_use]pub fn fused_mul_neg_add_m128(a: m128, b: m128, c: m128) -> m128
This is supported with target feature fma only.

Lanewise fused -(a * b) + c

let a = m128::from_array([2.0, 3.0, 4.0, 5.0]);
let b = m128::from_array([4.0, 5.0, 6.0, 7.0]);
let c = m128::from_array([1.0, 1.0, 1.0, 1.0]);
let d = fused_mul_neg_add_m128(a, b, c).to_array();
assert_eq!(d, [-7.0, -14.0, -23.0, -34.0]);
  • Intrinsic: _mm_fnmadd_ps
  • Assembly: one of
    • vfnmadd132ps xmm, xmm, xmm
    • vfnmadd213ps xmm, xmm, xmm
    • vfnmadd231ps xmm, xmm, xmm